int main(int argc, char* argv[])
{
    {
        false_value tr;
        tr = check<__has_virtual_destructor(A1)>::f();
    }

    {
        false_value tr;
        tr = check<__has_virtual_destructor(A2)>::f();
    }

    {
        false_value tr;
        tr = check<__has_virtual_destructor(A3)>::f();
    }

    {
        false_value tr;
        tr = check<__has_virtual_destructor(A4)>::f();
    }

    {
        false_value tr;
        tr = check<__has_virtual_destructor(A5)>::f();
    }

    {
        false_value tr;
        tr = check<__has_virtual_destructor(A6)>::f();
    }

    {
        true_value tr;
        tr = check<__has_virtual_destructor(A7)>::f();
    }

    {
        true_value tr;
        tr = check<__has_virtual_destructor(A8)>::f();
    }

    {
        true_value tr;
        tr = check<__has_virtual_destructor(A9)>::f();
    }

    {
        false_value tr;
        tr = check<__has_virtual_destructor(A10)>::f();
    }
}
예제 #2
0
bool tco4 = __has_trivial_constructor(void);
bool tco5 = __has_trivial_constructor(const void);

bool ncp1 = __has_nothrow_copy(I); // { dg-error "incomplete type" }
bool ncp2 = __has_nothrow_copy(C[]);
bool ncp3 = __has_nothrow_copy(I[]); // { dg-error "incomplete type" }
bool ncp4 = __has_nothrow_copy(void);
bool ncp5 = __has_nothrow_copy(const void);

bool tcp1 = __has_trivial_copy(I); // { dg-error "incomplete type" }
bool tcp2 = __has_trivial_copy(C[]);
bool tcp3 = __has_trivial_copy(I[]); // { dg-error "incomplete type" }
bool tcp4 = __has_trivial_copy(void);
bool tcp5 = __has_trivial_copy(const void);

bool vde1 = __has_virtual_destructor(I); // { dg-error "incomplete type" }
bool vde2 = __has_virtual_destructor(C[]);
bool vde3 = __has_virtual_destructor(I[]); // { dg-error "incomplete type" }
bool vde4 = __has_virtual_destructor(void);
bool vde5 = __has_virtual_destructor(const void);

bool tde1 = __has_trivial_destructor(I); // { dg-error "incomplete type" }
bool tde2 = __has_trivial_destructor(C[]);
bool tde3 = __has_trivial_destructor(I[]); // { dg-error "incomplete type" }
bool tde4 = __has_trivial_destructor(void);
bool tde5 = __has_trivial_destructor(const void);

bool abs1 = __is_abstract(I); // { dg-error "incomplete type" }
bool abs2 = __is_abstract(C[]);
bool abs3 = __is_abstract(I[]); // { dg-error "incomplete type" }
bool abs4 = __is_abstract(void);
예제 #3
0
파일: traits1.C 프로젝트: ChenBoTang/gcc
 concept bool Dynamically_destructible() { return __has_virtual_destructor(T); }