Home | History | Annotate | Download | only in SemaCXX
      1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++11 %s
      2 #define T(b) (b) ? 1 : -1
      3 #define F(b) (b) ? -1 : 1
      4 
      5 struct NonPOD { NonPOD(int); };
      6 
      7 // PODs
      8 enum Enum { EV };
      9 struct POD { Enum e; int i; float f; NonPOD* p; };
     10 struct Empty {};
     11 typedef Empty EmptyAr[10];
     12 typedef int Int;
     13 typedef Int IntAr[10];
     14 typedef Int IntArNB[];
     15 class Statics { static int priv; static NonPOD np; };
     16 union EmptyUnion {};
     17 union Union { int i; float f; };
     18 struct HasFunc { void f (); };
     19 struct HasOp { void operator *(); };
     20 struct HasConv { operator int(); };
     21 struct HasAssign { void operator =(int); };
     22 
     23 struct HasAnonymousUnion {
     24   union {
     25     int i;
     26     float f;
     27   };
     28 };
     29 
     30 typedef int Vector __attribute__((vector_size(16)));
     31 typedef int VectorExt __attribute__((ext_vector_type(4)));
     32 
     33 // Not PODs
     34 typedef const void cvoid;
     35 struct Derives : POD {};
     36 typedef Derives DerivesAr[10];
     37 typedef Derives DerivesArNB[];
     38 struct DerivesEmpty : Empty {};
     39 struct HasCons { HasCons(int); };
     40 struct HasCopyAssign { HasCopyAssign operator =(const HasCopyAssign&); };
     41 struct HasMoveAssign { HasMoveAssign operator =(const HasMoveAssign&&); };
     42 struct HasNoThrowMoveAssign {
     43   HasNoThrowMoveAssign& operator=(
     44     const HasNoThrowMoveAssign&&) throw(); };
     45 struct HasNoExceptNoThrowMoveAssign {
     46   HasNoExceptNoThrowMoveAssign& operator=(
     47     const HasNoExceptNoThrowMoveAssign&&) noexcept;
     48 };
     49 struct HasThrowMoveAssign {
     50   HasThrowMoveAssign& operator=(
     51     const HasThrowMoveAssign&&) throw(POD); };
     52 struct HasNoExceptFalseMoveAssign {
     53   HasNoExceptFalseMoveAssign& operator=(
     54     const HasNoExceptFalseMoveAssign&&) noexcept(false); };
     55 struct HasMoveCtor { HasMoveCtor(const HasMoveCtor&&); };
     56 struct HasMemberMoveCtor { HasMoveCtor member; };
     57 struct HasMemberMoveAssign { HasMoveAssign member; };
     58 struct HasStaticMemberMoveCtor { static HasMoveCtor member; };
     59 struct HasStaticMemberMoveAssign { static HasMoveAssign member; };
     60 struct HasMemberThrowMoveAssign { HasThrowMoveAssign member; };
     61 struct HasMemberNoExceptFalseMoveAssign {
     62   HasNoExceptFalseMoveAssign member; };
     63 struct HasMemberNoThrowMoveAssign { HasNoThrowMoveAssign member; };
     64 struct HasMemberNoExceptNoThrowMoveAssign {
     65   HasNoExceptNoThrowMoveAssign member; };
     66 
     67 struct HasDefaultTrivialCopyAssign {
     68   HasDefaultTrivialCopyAssign &operator=(
     69     const HasDefaultTrivialCopyAssign&) = default;
     70 };
     71 struct TrivialMoveButNotCopy {
     72   TrivialMoveButNotCopy &operator=(TrivialMoveButNotCopy&&) = default;
     73   TrivialMoveButNotCopy &operator=(const TrivialMoveButNotCopy&);
     74 };
     75 struct NonTrivialDefault {
     76   NonTrivialDefault();
     77 };
     78 
     79 struct HasDest { ~HasDest(); };
     80 class  HasPriv { int priv; };
     81 class  HasProt { protected: int prot; };
     82 struct HasRef { int i; int& ref; HasRef() : i(0), ref(i) {} };
     83 struct HasNonPOD { NonPOD np; };
     84 struct HasVirt { virtual void Virt() {}; };
     85 typedef NonPOD NonPODAr[10];
     86 typedef HasVirt VirtAr[10];
     87 typedef NonPOD NonPODArNB[];
     88 union NonPODUnion { int i; Derives n; };
     89 struct DerivesHasCons : HasCons {};
     90 struct DerivesHasCopyAssign : HasCopyAssign {};
     91 struct DerivesHasMoveAssign : HasMoveAssign {};
     92 struct DerivesHasDest : HasDest {};
     93 struct DerivesHasPriv : HasPriv {};
     94 struct DerivesHasProt : HasProt {};
     95 struct DerivesHasRef : HasRef {};
     96 struct DerivesHasVirt : HasVirt {};
     97 struct DerivesHasMoveCtor : HasMoveCtor {};
     98 
     99 struct HasNoThrowCopyAssign {
    100   void operator =(const HasNoThrowCopyAssign&) throw();
    101 };
    102 struct HasMultipleCopyAssign {
    103   void operator =(const HasMultipleCopyAssign&) throw();
    104   void operator =(volatile HasMultipleCopyAssign&);
    105 };
    106 struct HasMultipleNoThrowCopyAssign {
    107   void operator =(const HasMultipleNoThrowCopyAssign&) throw();
    108   void operator =(volatile HasMultipleNoThrowCopyAssign&) throw();
    109 };
    110 
    111 struct HasNoThrowConstructor { HasNoThrowConstructor() throw(); };
    112 struct HasNoThrowConstructorWithArgs {
    113   HasNoThrowConstructorWithArgs(HasCons i = HasCons(0)) throw();
    114 };
    115 
    116 struct HasNoThrowCopy { HasNoThrowCopy(const HasNoThrowCopy&) throw(); };
    117 struct HasMultipleCopy {
    118   HasMultipleCopy(const HasMultipleCopy&) throw();
    119   HasMultipleCopy(volatile HasMultipleCopy&);
    120 };
    121 struct HasMultipleNoThrowCopy {
    122   HasMultipleNoThrowCopy(const HasMultipleNoThrowCopy&) throw();
    123   HasMultipleNoThrowCopy(volatile HasMultipleNoThrowCopy&) throw();
    124 };
    125 
    126 struct HasVirtDest { virtual ~HasVirtDest(); };
    127 struct DerivedVirtDest : HasVirtDest {};
    128 typedef HasVirtDest VirtDestAr[1];
    129 
    130 class AllPrivate {
    131   AllPrivate() throw();
    132   AllPrivate(const AllPrivate&) throw();
    133   AllPrivate &operator=(const AllPrivate &) throw();
    134   ~AllPrivate() throw();
    135 };
    136 
    137 struct ThreeArgCtor {
    138   ThreeArgCtor(int*, char*, int);
    139 };
    140 
    141 void is_pod()
    142 {
    143   { int arr[T(__is_pod(int))]; }
    144   { int arr[T(__is_pod(Enum))]; }
    145   { int arr[T(__is_pod(POD))]; }
    146   { int arr[T(__is_pod(Int))]; }
    147   { int arr[T(__is_pod(IntAr))]; }
    148   { int arr[T(__is_pod(Statics))]; }
    149   { int arr[T(__is_pod(Empty))]; }
    150   { int arr[T(__is_pod(EmptyUnion))]; }
    151   { int arr[T(__is_pod(Union))]; }
    152   { int arr[T(__is_pod(HasFunc))]; }
    153   { int arr[T(__is_pod(HasOp))]; }
    154   { int arr[T(__is_pod(HasConv))]; }
    155   { int arr[T(__is_pod(HasAssign))]; }
    156   { int arr[T(__is_pod(IntArNB))]; }
    157   { int arr[T(__is_pod(HasAnonymousUnion))]; }
    158   { int arr[T(__is_pod(Vector))]; }
    159   { int arr[T(__is_pod(VectorExt))]; }
    160   { int arr[T(__is_pod(Derives))]; }
    161   { int arr[T(__is_pod(DerivesAr))]; }
    162   { int arr[T(__is_pod(DerivesArNB))]; }
    163   { int arr[T(__is_pod(DerivesEmpty))]; }
    164   { int arr[T(__is_pod(HasPriv))]; }
    165   { int arr[T(__is_pod(HasProt))]; }
    166   { int arr[T(__is_pod(DerivesHasPriv))]; }
    167   { int arr[T(__is_pod(DerivesHasProt))]; }
    168 
    169   { int arr[F(__is_pod(HasCons))]; }
    170   { int arr[F(__is_pod(HasCopyAssign))]; }
    171   { int arr[F(__is_pod(HasMoveAssign))]; }
    172   { int arr[F(__is_pod(HasDest))]; }
    173   { int arr[F(__is_pod(HasRef))]; }
    174   { int arr[F(__is_pod(HasVirt))]; }
    175   { int arr[F(__is_pod(DerivesHasCons))]; }
    176   { int arr[F(__is_pod(DerivesHasCopyAssign))]; }
    177   { int arr[F(__is_pod(DerivesHasMoveAssign))]; }
    178   { int arr[F(__is_pod(DerivesHasDest))]; }
    179   { int arr[F(__is_pod(DerivesHasRef))]; }
    180   { int arr[F(__is_pod(DerivesHasVirt))]; }
    181   { int arr[F(__is_pod(NonPOD))]; }
    182   { int arr[F(__is_pod(HasNonPOD))]; }
    183   { int arr[F(__is_pod(NonPODAr))]; }
    184   { int arr[F(__is_pod(NonPODArNB))]; }
    185   { int arr[F(__is_pod(void))]; }
    186   { int arr[F(__is_pod(cvoid))]; }
    187 // { int arr[F(__is_pod(NonPODUnion))]; }
    188 }
    189 
    190 typedef Empty EmptyAr[10];
    191 struct Bit0 { int : 0; };
    192 struct Bit0Cons { int : 0; Bit0Cons(); };
    193 struct BitOnly { int x : 3; };
    194 struct DerivesVirt : virtual POD {};
    195 
    196 void is_empty()
    197 {
    198   { int arr[T(__is_empty(Empty))]; }
    199   { int arr[T(__is_empty(DerivesEmpty))]; }
    200   { int arr[T(__is_empty(HasCons))]; }
    201   { int arr[T(__is_empty(HasCopyAssign))]; }
    202   { int arr[T(__is_empty(HasMoveAssign))]; }
    203   { int arr[T(__is_empty(HasDest))]; }
    204   { int arr[T(__is_empty(HasFunc))]; }
    205   { int arr[T(__is_empty(HasOp))]; }
    206   { int arr[T(__is_empty(HasConv))]; }
    207   { int arr[T(__is_empty(HasAssign))]; }
    208   { int arr[T(__is_empty(Bit0))]; }
    209   { int arr[T(__is_empty(Bit0Cons))]; }
    210 
    211   { int arr[F(__is_empty(Int))]; }
    212   { int arr[F(__is_empty(POD))]; }
    213   { int arr[F(__is_empty(EmptyUnion))]; }
    214   { int arr[F(__is_empty(EmptyAr))]; }
    215   { int arr[F(__is_empty(HasRef))]; }
    216   { int arr[F(__is_empty(HasVirt))]; }
    217   { int arr[F(__is_empty(BitOnly))]; }
    218   { int arr[F(__is_empty(void))]; }
    219   { int arr[F(__is_empty(IntArNB))]; }
    220   { int arr[F(__is_empty(HasAnonymousUnion))]; }
    221 //  { int arr[F(__is_empty(DerivesVirt))]; }
    222 }
    223 
    224 typedef Derives ClassType;
    225 
    226 void is_class()
    227 {
    228   { int arr[T(__is_class(Derives))]; }
    229   { int arr[T(__is_class(HasPriv))]; }
    230   { int arr[T(__is_class(ClassType))]; }
    231   { int arr[T(__is_class(HasAnonymousUnion))]; }
    232 
    233   { int arr[F(__is_class(int))]; }
    234   { int arr[F(__is_class(Enum))]; }
    235   { int arr[F(__is_class(Int))]; }
    236   { int arr[F(__is_class(IntAr))]; }
    237   { int arr[F(__is_class(DerivesAr))]; }
    238   { int arr[F(__is_class(Union))]; }
    239   { int arr[F(__is_class(cvoid))]; }
    240   { int arr[F(__is_class(IntArNB))]; }
    241 }
    242 
    243 typedef Union UnionAr[10];
    244 typedef Union UnionType;
    245 
    246 void is_union()
    247 {
    248   { int arr[T(__is_union(Union))]; }
    249   { int arr[T(__is_union(UnionType))]; }
    250 
    251   { int arr[F(__is_union(int))]; }
    252   { int arr[F(__is_union(Enum))]; }
    253   { int arr[F(__is_union(Int))]; }
    254   { int arr[F(__is_union(IntAr))]; }
    255   { int arr[F(__is_union(UnionAr))]; }
    256   { int arr[F(__is_union(cvoid))]; }
    257   { int arr[F(__is_union(IntArNB))]; }
    258   { int arr[F(__is_union(HasAnonymousUnion))]; }
    259 }
    260 
    261 typedef Enum EnumType;
    262 
    263 void is_enum()
    264 {
    265   { int arr[T(__is_enum(Enum))]; }
    266   { int arr[T(__is_enum(EnumType))]; }
    267 
    268   { int arr[F(__is_enum(int))]; }
    269   { int arr[F(__is_enum(Union))]; }
    270   { int arr[F(__is_enum(Int))]; }
    271   { int arr[F(__is_enum(IntAr))]; }
    272   { int arr[F(__is_enum(UnionAr))]; }
    273   { int arr[F(__is_enum(Derives))]; }
    274   { int arr[F(__is_enum(ClassType))]; }
    275   { int arr[F(__is_enum(cvoid))]; }
    276   { int arr[F(__is_enum(IntArNB))]; }
    277   { int arr[F(__is_enum(HasAnonymousUnion))]; }
    278 }
    279 
    280 struct FinalClass final {
    281 };
    282 
    283 template<typename T>
    284 struct PotentiallyFinal { };
    285 
    286 template<typename T>
    287 struct PotentiallyFinal<T*> final { };
    288 
    289 template<>
    290 struct PotentiallyFinal<int> final { };
    291 
    292 void is_final()
    293 {
    294 	{ int arr[T(__is_final(FinalClass))]; }
    295 	{ int arr[T(__is_final(PotentiallyFinal<float*>))]; }
    296 	{ int arr[T(__is_final(PotentiallyFinal<int>))]; }
    297 
    298 	{ int arr[F(__is_final(int))]; }
    299 	{ int arr[F(__is_final(Union))]; }
    300 	{ int arr[F(__is_final(Int))]; }
    301 	{ int arr[F(__is_final(IntAr))]; }
    302 	{ int arr[F(__is_final(UnionAr))]; }
    303 	{ int arr[F(__is_final(Derives))]; }
    304 	{ int arr[F(__is_final(ClassType))]; }
    305 	{ int arr[F(__is_final(cvoid))]; }
    306 	{ int arr[F(__is_final(IntArNB))]; }
    307 	{ int arr[F(__is_final(HasAnonymousUnion))]; }
    308 	{ int arr[F(__is_final(PotentiallyFinal<float>))]; }
    309 }
    310 
    311 typedef HasVirt Polymorph;
    312 struct InheritPolymorph : Polymorph {};
    313 
    314 void is_polymorphic()
    315 {
    316   { int arr[T(__is_polymorphic(Polymorph))]; }
    317   { int arr[T(__is_polymorphic(InheritPolymorph))]; }
    318 
    319   { int arr[F(__is_polymorphic(int))]; }
    320   { int arr[F(__is_polymorphic(Union))]; }
    321   { int arr[F(__is_polymorphic(Int))]; }
    322   { int arr[F(__is_polymorphic(IntAr))]; }
    323   { int arr[F(__is_polymorphic(UnionAr))]; }
    324   { int arr[F(__is_polymorphic(Derives))]; }
    325   { int arr[F(__is_polymorphic(ClassType))]; }
    326   { int arr[F(__is_polymorphic(Enum))]; }
    327   { int arr[F(__is_polymorphic(cvoid))]; }
    328   { int arr[F(__is_polymorphic(IntArNB))]; }
    329 }
    330 
    331 void is_integral()
    332 {
    333   int t01[T(__is_integral(bool))];
    334   int t02[T(__is_integral(char))];
    335   int t03[T(__is_integral(signed char))];
    336   int t04[T(__is_integral(unsigned char))];
    337   //int t05[T(__is_integral(char16_t))];
    338   //int t06[T(__is_integral(char32_t))];
    339   int t07[T(__is_integral(wchar_t))];
    340   int t08[T(__is_integral(short))];
    341   int t09[T(__is_integral(unsigned short))];
    342   int t10[T(__is_integral(int))];
    343   int t11[T(__is_integral(unsigned int))];
    344   int t12[T(__is_integral(long))];
    345   int t13[T(__is_integral(unsigned long))];
    346 
    347   int t21[F(__is_integral(float))];
    348   int t22[F(__is_integral(double))];
    349   int t23[F(__is_integral(long double))];
    350   int t24[F(__is_integral(Union))];
    351   int t25[F(__is_integral(UnionAr))];
    352   int t26[F(__is_integral(Derives))];
    353   int t27[F(__is_integral(ClassType))];
    354   int t28[F(__is_integral(Enum))];
    355   int t29[F(__is_integral(void))];
    356   int t30[F(__is_integral(cvoid))];
    357   int t31[F(__is_integral(IntArNB))];
    358 }
    359 
    360 void is_floating_point()
    361 {
    362   int t01[T(__is_floating_point(float))];
    363   int t02[T(__is_floating_point(double))];
    364   int t03[T(__is_floating_point(long double))];
    365 
    366   int t11[F(__is_floating_point(bool))];
    367   int t12[F(__is_floating_point(char))];
    368   int t13[F(__is_floating_point(signed char))];
    369   int t14[F(__is_floating_point(unsigned char))];
    370   //int t15[F(__is_floating_point(char16_t))];
    371   //int t16[F(__is_floating_point(char32_t))];
    372   int t17[F(__is_floating_point(wchar_t))];
    373   int t18[F(__is_floating_point(short))];
    374   int t19[F(__is_floating_point(unsigned short))];
    375   int t20[F(__is_floating_point(int))];
    376   int t21[F(__is_floating_point(unsigned int))];
    377   int t22[F(__is_floating_point(long))];
    378   int t23[F(__is_floating_point(unsigned long))];
    379   int t24[F(__is_floating_point(Union))];
    380   int t25[F(__is_floating_point(UnionAr))];
    381   int t26[F(__is_floating_point(Derives))];
    382   int t27[F(__is_floating_point(ClassType))];
    383   int t28[F(__is_floating_point(Enum))];
    384   int t29[F(__is_floating_point(void))];
    385   int t30[F(__is_floating_point(cvoid))];
    386   int t31[F(__is_floating_point(IntArNB))];
    387 }
    388 
    389 void is_arithmetic()
    390 {
    391   int t01[T(__is_arithmetic(float))];
    392   int t02[T(__is_arithmetic(double))];
    393   int t03[T(__is_arithmetic(long double))];
    394   int t11[T(__is_arithmetic(bool))];
    395   int t12[T(__is_arithmetic(char))];
    396   int t13[T(__is_arithmetic(signed char))];
    397   int t14[T(__is_arithmetic(unsigned char))];
    398   //int t15[T(__is_arithmetic(char16_t))];
    399   //int t16[T(__is_arithmetic(char32_t))];
    400   int t17[T(__is_arithmetic(wchar_t))];
    401   int t18[T(__is_arithmetic(short))];
    402   int t19[T(__is_arithmetic(unsigned short))];
    403   int t20[T(__is_arithmetic(int))];
    404   int t21[T(__is_arithmetic(unsigned int))];
    405   int t22[T(__is_arithmetic(long))];
    406   int t23[T(__is_arithmetic(unsigned long))];
    407 
    408   int t24[F(__is_arithmetic(Union))];
    409   int t25[F(__is_arithmetic(UnionAr))];
    410   int t26[F(__is_arithmetic(Derives))];
    411   int t27[F(__is_arithmetic(ClassType))];
    412   int t28[F(__is_arithmetic(Enum))];
    413   int t29[F(__is_arithmetic(void))];
    414   int t30[F(__is_arithmetic(cvoid))];
    415   int t31[F(__is_arithmetic(IntArNB))];
    416 }
    417 
    418 struct ACompleteType {};
    419 struct AnIncompleteType;
    420 
    421 void is_complete_type()
    422 {
    423   int t01[T(__is_complete_type(float))];
    424   int t02[T(__is_complete_type(double))];
    425   int t03[T(__is_complete_type(long double))];
    426   int t11[T(__is_complete_type(bool))];
    427   int t12[T(__is_complete_type(char))];
    428   int t13[T(__is_complete_type(signed char))];
    429   int t14[T(__is_complete_type(unsigned char))];
    430   //int t15[T(__is_complete_type(char16_t))];
    431   //int t16[T(__is_complete_type(char32_t))];
    432   int t17[T(__is_complete_type(wchar_t))];
    433   int t18[T(__is_complete_type(short))];
    434   int t19[T(__is_complete_type(unsigned short))];
    435   int t20[T(__is_complete_type(int))];
    436   int t21[T(__is_complete_type(unsigned int))];
    437   int t22[T(__is_complete_type(long))];
    438   int t23[T(__is_complete_type(unsigned long))];
    439   int t24[T(__is_complete_type(ACompleteType))];
    440 
    441   int t30[F(__is_complete_type(AnIncompleteType))];
    442 }
    443 
    444 void is_void()
    445 {
    446   int t01[T(__is_void(void))];
    447   int t02[T(__is_void(cvoid))];
    448 
    449   int t10[F(__is_void(float))];
    450   int t11[F(__is_void(double))];
    451   int t12[F(__is_void(long double))];
    452   int t13[F(__is_void(bool))];
    453   int t14[F(__is_void(char))];
    454   int t15[F(__is_void(signed char))];
    455   int t16[F(__is_void(unsigned char))];
    456   int t17[F(__is_void(wchar_t))];
    457   int t18[F(__is_void(short))];
    458   int t19[F(__is_void(unsigned short))];
    459   int t20[F(__is_void(int))];
    460   int t21[F(__is_void(unsigned int))];
    461   int t22[F(__is_void(long))];
    462   int t23[F(__is_void(unsigned long))];
    463   int t24[F(__is_void(Union))];
    464   int t25[F(__is_void(UnionAr))];
    465   int t26[F(__is_void(Derives))];
    466   int t27[F(__is_void(ClassType))];
    467   int t28[F(__is_void(Enum))];
    468   int t29[F(__is_void(IntArNB))];
    469   int t30[F(__is_void(void*))];
    470   int t31[F(__is_void(cvoid*))];
    471 }
    472 
    473 void is_array()
    474 {
    475   int t01[T(__is_array(IntAr))];
    476   int t02[T(__is_array(IntArNB))];
    477   int t03[T(__is_array(UnionAr))];
    478 
    479   int t10[F(__is_array(void))];
    480   int t11[F(__is_array(cvoid))];
    481   int t12[F(__is_array(float))];
    482   int t13[F(__is_array(double))];
    483   int t14[F(__is_array(long double))];
    484   int t15[F(__is_array(bool))];
    485   int t16[F(__is_array(char))];
    486   int t17[F(__is_array(signed char))];
    487   int t18[F(__is_array(unsigned char))];
    488   int t19[F(__is_array(wchar_t))];
    489   int t20[F(__is_array(short))];
    490   int t21[F(__is_array(unsigned short))];
    491   int t22[F(__is_array(int))];
    492   int t23[F(__is_array(unsigned int))];
    493   int t24[F(__is_array(long))];
    494   int t25[F(__is_array(unsigned long))];
    495   int t26[F(__is_array(Union))];
    496   int t27[F(__is_array(Derives))];
    497   int t28[F(__is_array(ClassType))];
    498   int t29[F(__is_array(Enum))];
    499   int t30[F(__is_array(void*))];
    500   int t31[F(__is_array(cvoid*))];
    501 }
    502 
    503 template <typename T> void tmpl_func(T&) {}
    504 
    505 template <typename T> struct type_wrapper {
    506   typedef T type;
    507   typedef T* ptrtype;
    508   typedef T& reftype;
    509 };
    510 
    511 void is_function()
    512 {
    513   int t01[T(__is_function(type_wrapper<void(void)>::type))];
    514   int t02[T(__is_function(typeof(tmpl_func<int>)))];
    515 
    516   typedef void (*ptr_to_func_type)(void);
    517 
    518   int t10[F(__is_function(void))];
    519   int t11[F(__is_function(cvoid))];
    520   int t12[F(__is_function(float))];
    521   int t13[F(__is_function(double))];
    522   int t14[F(__is_function(long double))];
    523   int t15[F(__is_function(bool))];
    524   int t16[F(__is_function(char))];
    525   int t17[F(__is_function(signed char))];
    526   int t18[F(__is_function(unsigned char))];
    527   int t19[F(__is_function(wchar_t))];
    528   int t20[F(__is_function(short))];
    529   int t21[F(__is_function(unsigned short))];
    530   int t22[F(__is_function(int))];
    531   int t23[F(__is_function(unsigned int))];
    532   int t24[F(__is_function(long))];
    533   int t25[F(__is_function(unsigned long))];
    534   int t26[F(__is_function(Union))];
    535   int t27[F(__is_function(Derives))];
    536   int t28[F(__is_function(ClassType))];
    537   int t29[F(__is_function(Enum))];
    538   int t30[F(__is_function(void*))];
    539   int t31[F(__is_function(cvoid*))];
    540   int t32[F(__is_function(void(*)()))];
    541   int t33[F(__is_function(ptr_to_func_type))];
    542   int t34[F(__is_function(type_wrapper<void(void)>::ptrtype))];
    543   int t35[F(__is_function(type_wrapper<void(void)>::reftype))];
    544 }
    545 
    546 void is_reference()
    547 {
    548   int t01[T(__is_reference(int&))];
    549   int t02[T(__is_reference(const int&))];
    550   int t03[T(__is_reference(void *&))];
    551 
    552   int t10[F(__is_reference(int))];
    553   int t11[F(__is_reference(const int))];
    554   int t12[F(__is_reference(void *))];
    555 }
    556 
    557 void is_lvalue_reference()
    558 {
    559   int t01[T(__is_lvalue_reference(int&))];
    560   int t02[T(__is_lvalue_reference(void *&))];
    561   int t03[T(__is_lvalue_reference(const int&))];
    562   int t04[T(__is_lvalue_reference(void * const &))];
    563 
    564   int t10[F(__is_lvalue_reference(int))];
    565   int t11[F(__is_lvalue_reference(const int))];
    566   int t12[F(__is_lvalue_reference(void *))];
    567 }
    568 
    569 #if __has_feature(cxx_rvalue_references)
    570 
    571 void is_rvalue_reference()
    572 {
    573   int t01[T(__is_rvalue_reference(const int&&))];
    574   int t02[T(__is_rvalue_reference(void * const &&))];
    575 
    576   int t10[F(__is_rvalue_reference(int&))];
    577   int t11[F(__is_rvalue_reference(void *&))];
    578   int t12[F(__is_rvalue_reference(const int&))];
    579   int t13[F(__is_rvalue_reference(void * const &))];
    580   int t14[F(__is_rvalue_reference(int))];
    581   int t15[F(__is_rvalue_reference(const int))];
    582   int t16[F(__is_rvalue_reference(void *))];
    583 }
    584 
    585 #endif
    586 
    587 void is_fundamental()
    588 {
    589   int t01[T(__is_fundamental(float))];
    590   int t02[T(__is_fundamental(double))];
    591   int t03[T(__is_fundamental(long double))];
    592   int t11[T(__is_fundamental(bool))];
    593   int t12[T(__is_fundamental(char))];
    594   int t13[T(__is_fundamental(signed char))];
    595   int t14[T(__is_fundamental(unsigned char))];
    596   //int t15[T(__is_fundamental(char16_t))];
    597   //int t16[T(__is_fundamental(char32_t))];
    598   int t17[T(__is_fundamental(wchar_t))];
    599   int t18[T(__is_fundamental(short))];
    600   int t19[T(__is_fundamental(unsigned short))];
    601   int t20[T(__is_fundamental(int))];
    602   int t21[T(__is_fundamental(unsigned int))];
    603   int t22[T(__is_fundamental(long))];
    604   int t23[T(__is_fundamental(unsigned long))];
    605   int t24[T(__is_fundamental(void))];
    606   int t25[T(__is_fundamental(cvoid))];
    607 
    608   int t30[F(__is_fundamental(Union))];
    609   int t31[F(__is_fundamental(UnionAr))];
    610   int t32[F(__is_fundamental(Derives))];
    611   int t33[F(__is_fundamental(ClassType))];
    612   int t34[F(__is_fundamental(Enum))];
    613   int t35[F(__is_fundamental(IntArNB))];
    614 }
    615 
    616 void is_object()
    617 {
    618   int t01[T(__is_object(int))];
    619   int t02[T(__is_object(int *))];
    620   int t03[T(__is_object(void *))];
    621   int t04[T(__is_object(Union))];
    622   int t05[T(__is_object(UnionAr))];
    623   int t06[T(__is_object(ClassType))];
    624   int t07[T(__is_object(Enum))];
    625 
    626   int t10[F(__is_object(type_wrapper<void(void)>::type))];
    627   int t11[F(__is_object(int&))];
    628   int t12[F(__is_object(void))];
    629 }
    630 
    631 void is_scalar()
    632 {
    633   int t01[T(__is_scalar(float))];
    634   int t02[T(__is_scalar(double))];
    635   int t03[T(__is_scalar(long double))];
    636   int t04[T(__is_scalar(bool))];
    637   int t05[T(__is_scalar(char))];
    638   int t06[T(__is_scalar(signed char))];
    639   int t07[T(__is_scalar(unsigned char))];
    640   int t08[T(__is_scalar(wchar_t))];
    641   int t09[T(__is_scalar(short))];
    642   int t10[T(__is_scalar(unsigned short))];
    643   int t11[T(__is_scalar(int))];
    644   int t12[T(__is_scalar(unsigned int))];
    645   int t13[T(__is_scalar(long))];
    646   int t14[T(__is_scalar(unsigned long))];
    647   int t15[T(__is_scalar(Enum))];
    648   int t16[T(__is_scalar(void*))];
    649   int t17[T(__is_scalar(cvoid*))];
    650 
    651   int t20[F(__is_scalar(void))];
    652   int t21[F(__is_scalar(cvoid))];
    653   int t22[F(__is_scalar(Union))];
    654   int t23[F(__is_scalar(UnionAr))];
    655   int t24[F(__is_scalar(Derives))];
    656   int t25[F(__is_scalar(ClassType))];
    657   int t26[F(__is_scalar(IntArNB))];
    658 }
    659 
    660 struct StructWithMembers {
    661   int member;
    662   void method() {}
    663 };
    664 
    665 void is_compound()
    666 {
    667   int t01[T(__is_compound(void*))];
    668   int t02[T(__is_compound(cvoid*))];
    669   int t03[T(__is_compound(void (*)()))];
    670   int t04[T(__is_compound(int StructWithMembers::*))];
    671   int t05[T(__is_compound(void (StructWithMembers::*)()))];
    672   int t06[T(__is_compound(int&))];
    673   int t07[T(__is_compound(Union))];
    674   int t08[T(__is_compound(UnionAr))];
    675   int t09[T(__is_compound(Derives))];
    676   int t10[T(__is_compound(ClassType))];
    677   int t11[T(__is_compound(IntArNB))];
    678   int t12[T(__is_compound(Enum))];
    679 
    680   int t20[F(__is_compound(float))];
    681   int t21[F(__is_compound(double))];
    682   int t22[F(__is_compound(long double))];
    683   int t23[F(__is_compound(bool))];
    684   int t24[F(__is_compound(char))];
    685   int t25[F(__is_compound(signed char))];
    686   int t26[F(__is_compound(unsigned char))];
    687   int t27[F(__is_compound(wchar_t))];
    688   int t28[F(__is_compound(short))];
    689   int t29[F(__is_compound(unsigned short))];
    690   int t30[F(__is_compound(int))];
    691   int t31[F(__is_compound(unsigned int))];
    692   int t32[F(__is_compound(long))];
    693   int t33[F(__is_compound(unsigned long))];
    694   int t34[F(__is_compound(void))];
    695   int t35[F(__is_compound(cvoid))];
    696 }
    697 
    698 void is_pointer()
    699 {
    700   StructWithMembers x;
    701 
    702   int t01[T(__is_pointer(void*))];
    703   int t02[T(__is_pointer(cvoid*))];
    704   int t03[T(__is_pointer(cvoid*))];
    705   int t04[T(__is_pointer(char*))];
    706   int t05[T(__is_pointer(int*))];
    707   int t06[T(__is_pointer(int**))];
    708   int t07[T(__is_pointer(ClassType*))];
    709   int t08[T(__is_pointer(Derives*))];
    710   int t09[T(__is_pointer(Enum*))];
    711   int t10[T(__is_pointer(IntArNB*))];
    712   int t11[T(__is_pointer(Union*))];
    713   int t12[T(__is_pointer(UnionAr*))];
    714   int t13[T(__is_pointer(StructWithMembers*))];
    715   int t14[T(__is_pointer(void (*)()))];
    716 
    717   int t20[F(__is_pointer(void))];
    718   int t21[F(__is_pointer(cvoid))];
    719   int t22[F(__is_pointer(cvoid))];
    720   int t23[F(__is_pointer(char))];
    721   int t24[F(__is_pointer(int))];
    722   int t25[F(__is_pointer(int))];
    723   int t26[F(__is_pointer(ClassType))];
    724   int t27[F(__is_pointer(Derives))];
    725   int t28[F(__is_pointer(Enum))];
    726   int t29[F(__is_pointer(IntArNB))];
    727   int t30[F(__is_pointer(Union))];
    728   int t31[F(__is_pointer(UnionAr))];
    729   int t32[F(__is_pointer(StructWithMembers))];
    730   int t33[F(__is_pointer(int StructWithMembers::*))];
    731   int t34[F(__is_pointer(void (StructWithMembers::*) ()))];
    732 }
    733 
    734 void is_member_object_pointer()
    735 {
    736   StructWithMembers x;
    737 
    738   int t01[T(__is_member_object_pointer(int StructWithMembers::*))];
    739 
    740   int t10[F(__is_member_object_pointer(void (StructWithMembers::*) ()))];
    741   int t11[F(__is_member_object_pointer(void*))];
    742   int t12[F(__is_member_object_pointer(cvoid*))];
    743   int t13[F(__is_member_object_pointer(cvoid*))];
    744   int t14[F(__is_member_object_pointer(char*))];
    745   int t15[F(__is_member_object_pointer(int*))];
    746   int t16[F(__is_member_object_pointer(int**))];
    747   int t17[F(__is_member_object_pointer(ClassType*))];
    748   int t18[F(__is_member_object_pointer(Derives*))];
    749   int t19[F(__is_member_object_pointer(Enum*))];
    750   int t20[F(__is_member_object_pointer(IntArNB*))];
    751   int t21[F(__is_member_object_pointer(Union*))];
    752   int t22[F(__is_member_object_pointer(UnionAr*))];
    753   int t23[F(__is_member_object_pointer(StructWithMembers*))];
    754   int t24[F(__is_member_object_pointer(void))];
    755   int t25[F(__is_member_object_pointer(cvoid))];
    756   int t26[F(__is_member_object_pointer(cvoid))];
    757   int t27[F(__is_member_object_pointer(char))];
    758   int t28[F(__is_member_object_pointer(int))];
    759   int t29[F(__is_member_object_pointer(int))];
    760   int t30[F(__is_member_object_pointer(ClassType))];
    761   int t31[F(__is_member_object_pointer(Derives))];
    762   int t32[F(__is_member_object_pointer(Enum))];
    763   int t33[F(__is_member_object_pointer(IntArNB))];
    764   int t34[F(__is_member_object_pointer(Union))];
    765   int t35[F(__is_member_object_pointer(UnionAr))];
    766   int t36[F(__is_member_object_pointer(StructWithMembers))];
    767   int t37[F(__is_member_object_pointer(void (*)()))];
    768 }
    769 
    770 void is_member_function_pointer()
    771 {
    772   StructWithMembers x;
    773 
    774   int t01[T(__is_member_function_pointer(void (StructWithMembers::*) ()))];
    775 
    776   int t10[F(__is_member_function_pointer(int StructWithMembers::*))];
    777   int t11[F(__is_member_function_pointer(void*))];
    778   int t12[F(__is_member_function_pointer(cvoid*))];
    779   int t13[F(__is_member_function_pointer(cvoid*))];
    780   int t14[F(__is_member_function_pointer(char*))];
    781   int t15[F(__is_member_function_pointer(int*))];
    782   int t16[F(__is_member_function_pointer(int**))];
    783   int t17[F(__is_member_function_pointer(ClassType*))];
    784   int t18[F(__is_member_function_pointer(Derives*))];
    785   int t19[F(__is_member_function_pointer(Enum*))];
    786   int t20[F(__is_member_function_pointer(IntArNB*))];
    787   int t21[F(__is_member_function_pointer(Union*))];
    788   int t22[F(__is_member_function_pointer(UnionAr*))];
    789   int t23[F(__is_member_function_pointer(StructWithMembers*))];
    790   int t24[F(__is_member_function_pointer(void))];
    791   int t25[F(__is_member_function_pointer(cvoid))];
    792   int t26[F(__is_member_function_pointer(cvoid))];
    793   int t27[F(__is_member_function_pointer(char))];
    794   int t28[F(__is_member_function_pointer(int))];
    795   int t29[F(__is_member_function_pointer(int))];
    796   int t30[F(__is_member_function_pointer(ClassType))];
    797   int t31[F(__is_member_function_pointer(Derives))];
    798   int t32[F(__is_member_function_pointer(Enum))];
    799   int t33[F(__is_member_function_pointer(IntArNB))];
    800   int t34[F(__is_member_function_pointer(Union))];
    801   int t35[F(__is_member_function_pointer(UnionAr))];
    802   int t36[F(__is_member_function_pointer(StructWithMembers))];
    803   int t37[F(__is_member_function_pointer(void (*)()))];
    804 }
    805 
    806 void is_member_pointer()
    807 {
    808   StructWithMembers x;
    809 
    810   int t01[T(__is_member_pointer(int StructWithMembers::*))];
    811   int t02[T(__is_member_pointer(void (StructWithMembers::*) ()))];
    812 
    813   int t10[F(__is_member_pointer(void*))];
    814   int t11[F(__is_member_pointer(cvoid*))];
    815   int t12[F(__is_member_pointer(cvoid*))];
    816   int t13[F(__is_member_pointer(char*))];
    817   int t14[F(__is_member_pointer(int*))];
    818   int t15[F(__is_member_pointer(int**))];
    819   int t16[F(__is_member_pointer(ClassType*))];
    820   int t17[F(__is_member_pointer(Derives*))];
    821   int t18[F(__is_member_pointer(Enum*))];
    822   int t19[F(__is_member_pointer(IntArNB*))];
    823   int t20[F(__is_member_pointer(Union*))];
    824   int t21[F(__is_member_pointer(UnionAr*))];
    825   int t22[F(__is_member_pointer(StructWithMembers*))];
    826   int t23[F(__is_member_pointer(void))];
    827   int t24[F(__is_member_pointer(cvoid))];
    828   int t25[F(__is_member_pointer(cvoid))];
    829   int t26[F(__is_member_pointer(char))];
    830   int t27[F(__is_member_pointer(int))];
    831   int t28[F(__is_member_pointer(int))];
    832   int t29[F(__is_member_pointer(ClassType))];
    833   int t30[F(__is_member_pointer(Derives))];
    834   int t31[F(__is_member_pointer(Enum))];
    835   int t32[F(__is_member_pointer(IntArNB))];
    836   int t33[F(__is_member_pointer(Union))];
    837   int t34[F(__is_member_pointer(UnionAr))];
    838   int t35[F(__is_member_pointer(StructWithMembers))];
    839   int t36[F(__is_member_pointer(void (*)()))];
    840 }
    841 
    842 void is_const()
    843 {
    844   int t01[T(__is_const(cvoid))];
    845   int t02[T(__is_const(const char))];
    846   int t03[T(__is_const(const int))];
    847   int t04[T(__is_const(const long))];
    848   int t05[T(__is_const(const short))];
    849   int t06[T(__is_const(const signed char))];
    850   int t07[T(__is_const(const wchar_t))];
    851   int t08[T(__is_const(const bool))];
    852   int t09[T(__is_const(const float))];
    853   int t10[T(__is_const(const double))];
    854   int t11[T(__is_const(const long double))];
    855   int t12[T(__is_const(const unsigned char))];
    856   int t13[T(__is_const(const unsigned int))];
    857   int t14[T(__is_const(const unsigned long long))];
    858   int t15[T(__is_const(const unsigned long))];
    859   int t16[T(__is_const(const unsigned short))];
    860   int t17[T(__is_const(const void))];
    861   int t18[T(__is_const(const ClassType))];
    862   int t19[T(__is_const(const Derives))];
    863   int t20[T(__is_const(const Enum))];
    864   int t21[T(__is_const(const IntArNB))];
    865   int t22[T(__is_const(const Union))];
    866   int t23[T(__is_const(const UnionAr))];
    867 
    868   int t30[F(__is_const(char))];
    869   int t31[F(__is_const(int))];
    870   int t32[F(__is_const(long))];
    871   int t33[F(__is_const(short))];
    872   int t34[F(__is_const(signed char))];
    873   int t35[F(__is_const(wchar_t))];
    874   int t36[F(__is_const(bool))];
    875   int t37[F(__is_const(float))];
    876   int t38[F(__is_const(double))];
    877   int t39[F(__is_const(long double))];
    878   int t40[F(__is_const(unsigned char))];
    879   int t41[F(__is_const(unsigned int))];
    880   int t42[F(__is_const(unsigned long long))];
    881   int t43[F(__is_const(unsigned long))];
    882   int t44[F(__is_const(unsigned short))];
    883   int t45[F(__is_const(void))];
    884   int t46[F(__is_const(ClassType))];
    885   int t47[F(__is_const(Derives))];
    886   int t48[F(__is_const(Enum))];
    887   int t49[F(__is_const(IntArNB))];
    888   int t50[F(__is_const(Union))];
    889   int t51[F(__is_const(UnionAr))];
    890 }
    891 
    892 void is_volatile()
    893 {
    894   int t02[T(__is_volatile(volatile char))];
    895   int t03[T(__is_volatile(volatile int))];
    896   int t04[T(__is_volatile(volatile long))];
    897   int t05[T(__is_volatile(volatile short))];
    898   int t06[T(__is_volatile(volatile signed char))];
    899   int t07[T(__is_volatile(volatile wchar_t))];
    900   int t08[T(__is_volatile(volatile bool))];
    901   int t09[T(__is_volatile(volatile float))];
    902   int t10[T(__is_volatile(volatile double))];
    903   int t11[T(__is_volatile(volatile long double))];
    904   int t12[T(__is_volatile(volatile unsigned char))];
    905   int t13[T(__is_volatile(volatile unsigned int))];
    906   int t14[T(__is_volatile(volatile unsigned long long))];
    907   int t15[T(__is_volatile(volatile unsigned long))];
    908   int t16[T(__is_volatile(volatile unsigned short))];
    909   int t17[T(__is_volatile(volatile void))];
    910   int t18[T(__is_volatile(volatile ClassType))];
    911   int t19[T(__is_volatile(volatile Derives))];
    912   int t20[T(__is_volatile(volatile Enum))];
    913   int t21[T(__is_volatile(volatile IntArNB))];
    914   int t22[T(__is_volatile(volatile Union))];
    915   int t23[T(__is_volatile(volatile UnionAr))];
    916 
    917   int t30[F(__is_volatile(char))];
    918   int t31[F(__is_volatile(int))];
    919   int t32[F(__is_volatile(long))];
    920   int t33[F(__is_volatile(short))];
    921   int t34[F(__is_volatile(signed char))];
    922   int t35[F(__is_volatile(wchar_t))];
    923   int t36[F(__is_volatile(bool))];
    924   int t37[F(__is_volatile(float))];
    925   int t38[F(__is_volatile(double))];
    926   int t39[F(__is_volatile(long double))];
    927   int t40[F(__is_volatile(unsigned char))];
    928   int t41[F(__is_volatile(unsigned int))];
    929   int t42[F(__is_volatile(unsigned long long))];
    930   int t43[F(__is_volatile(unsigned long))];
    931   int t44[F(__is_volatile(unsigned short))];
    932   int t45[F(__is_volatile(void))];
    933   int t46[F(__is_volatile(ClassType))];
    934   int t47[F(__is_volatile(Derives))];
    935   int t48[F(__is_volatile(Enum))];
    936   int t49[F(__is_volatile(IntArNB))];
    937   int t50[F(__is_volatile(Union))];
    938   int t51[F(__is_volatile(UnionAr))];
    939 }
    940 
    941 struct TrivialStruct {
    942   int member;
    943 };
    944 
    945 struct NonTrivialStruct {
    946   int member;
    947   NonTrivialStruct() {
    948     member = 0;
    949   }
    950 };
    951 
    952 struct SuperNonTrivialStruct {
    953   SuperNonTrivialStruct() { }
    954   ~SuperNonTrivialStruct() { }
    955 };
    956 
    957 struct NonTCStruct {
    958   NonTCStruct(const NonTCStruct&) {}
    959 };
    960 
    961 struct AllDefaulted {
    962   AllDefaulted() = default;
    963   AllDefaulted(const AllDefaulted &) = default;
    964   AllDefaulted(AllDefaulted &&) = default;
    965   AllDefaulted &operator=(const AllDefaulted &) = default;
    966   AllDefaulted &operator=(AllDefaulted &&) = default;
    967   ~AllDefaulted() = default;
    968 };
    969 
    970 struct NoDefaultMoveAssignDueToUDCopyCtor {
    971   NoDefaultMoveAssignDueToUDCopyCtor(const NoDefaultMoveAssignDueToUDCopyCtor&);
    972 };
    973 
    974 struct NoDefaultMoveAssignDueToUDCopyAssign {
    975   NoDefaultMoveAssignDueToUDCopyAssign& operator=(
    976     const NoDefaultMoveAssignDueToUDCopyAssign&);
    977 };
    978 
    979 struct NoDefaultMoveAssignDueToDtor {
    980   ~NoDefaultMoveAssignDueToDtor();
    981 };
    982 
    983 struct AllDeleted {
    984   AllDeleted() = delete;
    985   AllDeleted(const AllDeleted &) = delete;
    986   AllDeleted(AllDeleted &&) = delete;
    987   AllDeleted &operator=(const AllDeleted &) = delete;
    988   AllDeleted &operator=(AllDeleted &&) = delete;
    989   ~AllDeleted() = delete;
    990 };
    991 
    992 struct ExtDefaulted {
    993   ExtDefaulted();
    994   ExtDefaulted(const ExtDefaulted &);
    995   ExtDefaulted(ExtDefaulted &&);
    996   ExtDefaulted &operator=(const ExtDefaulted &);
    997   ExtDefaulted &operator=(ExtDefaulted &&);
    998   ~ExtDefaulted();
    999 };
   1000 
   1001 // Despite being defaulted, these functions are not trivial.
   1002 ExtDefaulted::ExtDefaulted() = default;
   1003 ExtDefaulted::ExtDefaulted(const ExtDefaulted &) = default;
   1004 ExtDefaulted::ExtDefaulted(ExtDefaulted &&) = default;
   1005 ExtDefaulted &ExtDefaulted::operator=(const ExtDefaulted &) = default;
   1006 ExtDefaulted &ExtDefaulted::operator=(ExtDefaulted &&) = default;
   1007 ExtDefaulted::~ExtDefaulted() = default;
   1008 
   1009 void is_trivial2()
   1010 {
   1011   int t01[T(__is_trivial(char))];
   1012   int t02[T(__is_trivial(int))];
   1013   int t03[T(__is_trivial(long))];
   1014   int t04[T(__is_trivial(short))];
   1015   int t05[T(__is_trivial(signed char))];
   1016   int t06[T(__is_trivial(wchar_t))];
   1017   int t07[T(__is_trivial(bool))];
   1018   int t08[T(__is_trivial(float))];
   1019   int t09[T(__is_trivial(double))];
   1020   int t10[T(__is_trivial(long double))];
   1021   int t11[T(__is_trivial(unsigned char))];
   1022   int t12[T(__is_trivial(unsigned int))];
   1023   int t13[T(__is_trivial(unsigned long long))];
   1024   int t14[T(__is_trivial(unsigned long))];
   1025   int t15[T(__is_trivial(unsigned short))];
   1026   int t16[T(__is_trivial(ClassType))];
   1027   int t17[T(__is_trivial(Derives))];
   1028   int t18[T(__is_trivial(Enum))];
   1029   int t19[T(__is_trivial(IntAr))];
   1030   int t20[T(__is_trivial(Union))];
   1031   int t21[T(__is_trivial(UnionAr))];
   1032   int t22[T(__is_trivial(TrivialStruct))];
   1033   int t23[T(__is_trivial(AllDefaulted))];
   1034   int t24[T(__is_trivial(AllDeleted))];
   1035 
   1036   int t30[F(__is_trivial(void))];
   1037   int t31[F(__is_trivial(NonTrivialStruct))];
   1038   int t32[F(__is_trivial(SuperNonTrivialStruct))];
   1039   int t33[F(__is_trivial(NonTCStruct))];
   1040   int t34[F(__is_trivial(ExtDefaulted))];
   1041 }
   1042 
   1043 void is_trivially_copyable2()
   1044 {
   1045   int t01[T(__is_trivially_copyable(char))];
   1046   int t02[T(__is_trivially_copyable(int))];
   1047   int t03[T(__is_trivially_copyable(long))];
   1048   int t04[T(__is_trivially_copyable(short))];
   1049   int t05[T(__is_trivially_copyable(signed char))];
   1050   int t06[T(__is_trivially_copyable(wchar_t))];
   1051   int t07[T(__is_trivially_copyable(bool))];
   1052   int t08[T(__is_trivially_copyable(float))];
   1053   int t09[T(__is_trivially_copyable(double))];
   1054   int t10[T(__is_trivially_copyable(long double))];
   1055   int t11[T(__is_trivially_copyable(unsigned char))];
   1056   int t12[T(__is_trivially_copyable(unsigned int))];
   1057   int t13[T(__is_trivially_copyable(unsigned long long))];
   1058   int t14[T(__is_trivially_copyable(unsigned long))];
   1059   int t15[T(__is_trivially_copyable(unsigned short))];
   1060   int t16[T(__is_trivially_copyable(ClassType))];
   1061   int t17[T(__is_trivially_copyable(Derives))];
   1062   int t18[T(__is_trivially_copyable(Enum))];
   1063   int t19[T(__is_trivially_copyable(IntAr))];
   1064   int t20[T(__is_trivially_copyable(Union))];
   1065   int t21[T(__is_trivially_copyable(UnionAr))];
   1066   int t22[T(__is_trivially_copyable(TrivialStruct))];
   1067   int t23[T(__is_trivially_copyable(NonTrivialStruct))];
   1068   int t24[T(__is_trivially_copyable(AllDefaulted))];
   1069   int t25[T(__is_trivially_copyable(AllDeleted))];
   1070 
   1071   int t30[F(__is_trivially_copyable(void))];
   1072   int t31[F(__is_trivially_copyable(SuperNonTrivialStruct))];
   1073   int t32[F(__is_trivially_copyable(NonTCStruct))];
   1074   int t33[F(__is_trivially_copyable(ExtDefaulted))];
   1075 }
   1076 
   1077 struct CStruct {
   1078   int one;
   1079   int two;
   1080 };
   1081 
   1082 struct CEmptyStruct {};
   1083 
   1084 struct CppEmptyStruct : CStruct {};
   1085 struct CppStructStandard : CEmptyStruct {
   1086   int three;
   1087   int four;
   1088 };
   1089 struct CppStructNonStandardByBase : CStruct {
   1090   int three;
   1091   int four;
   1092 };
   1093 struct CppStructNonStandardByVirt : CStruct {
   1094   virtual void method() {}
   1095 };
   1096 struct CppStructNonStandardByMemb : CStruct {
   1097   CppStructNonStandardByVirt member;
   1098 };
   1099 struct CppStructNonStandardByProt : CStruct {
   1100   int five;
   1101 protected:
   1102   int six;
   1103 };
   1104 struct CppStructNonStandardByVirtBase : virtual CStruct {
   1105 };
   1106 struct CppStructNonStandardBySameBase : CEmptyStruct {
   1107   CEmptyStruct member;
   1108 };
   1109 struct CppStructNonStandardBy2ndVirtBase : CEmptyStruct {
   1110   CEmptyStruct member;
   1111 };
   1112 
   1113 void is_standard_layout()
   1114 {
   1115   typedef const int ConstInt;
   1116   typedef ConstInt ConstIntAr[4];
   1117   typedef CppStructStandard CppStructStandardAr[4];
   1118 
   1119   int t01[T(__is_standard_layout(int))];
   1120   int t02[T(__is_standard_layout(ConstInt))];
   1121   int t03[T(__is_standard_layout(ConstIntAr))];
   1122   int t04[T(__is_standard_layout(CStruct))];
   1123   int t05[T(__is_standard_layout(CppStructStandard))];
   1124   int t06[T(__is_standard_layout(CppStructStandardAr))];
   1125   int t07[T(__is_standard_layout(Vector))];
   1126   int t08[T(__is_standard_layout(VectorExt))];
   1127 
   1128   typedef CppStructNonStandardByBase CppStructNonStandardByBaseAr[4];
   1129 
   1130   int t10[F(__is_standard_layout(CppStructNonStandardByVirt))];
   1131   int t11[F(__is_standard_layout(CppStructNonStandardByMemb))];
   1132   int t12[F(__is_standard_layout(CppStructNonStandardByProt))];
   1133   int t13[F(__is_standard_layout(CppStructNonStandardByVirtBase))];
   1134   int t14[F(__is_standard_layout(CppStructNonStandardByBase))];
   1135   int t15[F(__is_standard_layout(CppStructNonStandardByBaseAr))];
   1136   int t16[F(__is_standard_layout(CppStructNonStandardBySameBase))];
   1137   int t17[F(__is_standard_layout(CppStructNonStandardBy2ndVirtBase))];
   1138 }
   1139 
   1140 void is_signed()
   1141 {
   1142   //int t01[T(__is_signed(char))];
   1143   int t02[T(__is_signed(int))];
   1144   int t03[T(__is_signed(long))];
   1145   int t04[T(__is_signed(short))];
   1146   int t05[T(__is_signed(signed char))];
   1147   int t06[T(__is_signed(wchar_t))];
   1148 
   1149   int t10[F(__is_signed(bool))];
   1150   int t11[F(__is_signed(cvoid))];
   1151   int t12[F(__is_signed(float))];
   1152   int t13[F(__is_signed(double))];
   1153   int t14[F(__is_signed(long double))];
   1154   int t15[F(__is_signed(unsigned char))];
   1155   int t16[F(__is_signed(unsigned int))];
   1156   int t17[F(__is_signed(unsigned long long))];
   1157   int t18[F(__is_signed(unsigned long))];
   1158   int t19[F(__is_signed(unsigned short))];
   1159   int t20[F(__is_signed(void))];
   1160   int t21[F(__is_signed(ClassType))];
   1161   int t22[F(__is_signed(Derives))];
   1162   int t23[F(__is_signed(Enum))];
   1163   int t24[F(__is_signed(IntArNB))];
   1164   int t25[F(__is_signed(Union))];
   1165   int t26[F(__is_signed(UnionAr))];
   1166 }
   1167 
   1168 void is_unsigned()
   1169 {
   1170   int t01[T(__is_unsigned(bool))];
   1171   int t02[T(__is_unsigned(unsigned char))];
   1172   int t03[T(__is_unsigned(unsigned short))];
   1173   int t04[T(__is_unsigned(unsigned int))];
   1174   int t05[T(__is_unsigned(unsigned long))];
   1175   int t06[T(__is_unsigned(unsigned long long))];
   1176   int t07[T(__is_unsigned(Enum))];
   1177 
   1178   int t10[F(__is_unsigned(void))];
   1179   int t11[F(__is_unsigned(cvoid))];
   1180   int t12[F(__is_unsigned(float))];
   1181   int t13[F(__is_unsigned(double))];
   1182   int t14[F(__is_unsigned(long double))];
   1183   int t16[F(__is_unsigned(char))];
   1184   int t17[F(__is_unsigned(signed char))];
   1185   int t18[F(__is_unsigned(wchar_t))];
   1186   int t19[F(__is_unsigned(short))];
   1187   int t20[F(__is_unsigned(int))];
   1188   int t21[F(__is_unsigned(long))];
   1189   int t22[F(__is_unsigned(Union))];
   1190   int t23[F(__is_unsigned(UnionAr))];
   1191   int t24[F(__is_unsigned(Derives))];
   1192   int t25[F(__is_unsigned(ClassType))];
   1193   int t26[F(__is_unsigned(IntArNB))];
   1194 }
   1195 
   1196 typedef Int& IntRef;
   1197 typedef const IntAr ConstIntAr;
   1198 typedef ConstIntAr ConstIntArAr[4];
   1199 
   1200 struct HasCopy {
   1201   HasCopy(HasCopy& cp);
   1202 };
   1203 
   1204 struct HasMove {
   1205   HasMove(HasMove&& cp);
   1206 };
   1207 
   1208 struct HasTemplateCons {
   1209   HasVirt Annoying;
   1210 
   1211   template <typename T>
   1212   HasTemplateCons(const T&);
   1213 };
   1214 
   1215 void has_trivial_default_constructor() {
   1216   { int arr[T(__has_trivial_constructor(Int))]; }
   1217   { int arr[T(__has_trivial_constructor(IntAr))]; }
   1218   { int arr[T(__has_trivial_constructor(Union))]; }
   1219   { int arr[T(__has_trivial_constructor(UnionAr))]; }
   1220   { int arr[T(__has_trivial_constructor(POD))]; }
   1221   { int arr[T(__has_trivial_constructor(Derives))]; }
   1222   { int arr[T(__has_trivial_constructor(DerivesAr))]; }
   1223   { int arr[T(__has_trivial_constructor(ConstIntAr))]; }
   1224   { int arr[T(__has_trivial_constructor(ConstIntArAr))]; }
   1225   { int arr[T(__has_trivial_constructor(HasDest))]; }
   1226   { int arr[T(__has_trivial_constructor(HasPriv))]; }
   1227   { int arr[T(__has_trivial_constructor(HasCopyAssign))]; }
   1228   { int arr[T(__has_trivial_constructor(HasMoveAssign))]; }
   1229   { int arr[T(__has_trivial_constructor(const Int))]; }
   1230   { int arr[T(__has_trivial_constructor(AllDefaulted))]; }
   1231   { int arr[T(__has_trivial_constructor(AllDeleted))]; }
   1232 
   1233   { int arr[F(__has_trivial_constructor(HasCons))]; }
   1234   { int arr[F(__has_trivial_constructor(HasRef))]; }
   1235   { int arr[F(__has_trivial_constructor(HasCopy))]; }
   1236   { int arr[F(__has_trivial_constructor(IntRef))]; }
   1237   { int arr[F(__has_trivial_constructor(VirtAr))]; }
   1238   { int arr[F(__has_trivial_constructor(void))]; }
   1239   { int arr[F(__has_trivial_constructor(cvoid))]; }
   1240   { int arr[F(__has_trivial_constructor(HasTemplateCons))]; }
   1241   { int arr[F(__has_trivial_constructor(AllPrivate))]; }
   1242   { int arr[F(__has_trivial_constructor(ExtDefaulted))]; }
   1243 }
   1244 
   1245 void has_trivial_move_constructor() {
   1246   // n3376 12.8 [class.copy]/12
   1247   // A copy/move constructor for class X is trivial if it is not
   1248   // user-provided, its declared parameter type is the same as
   1249   // if it had been implicitly declared, and if
   1250   //    class X has no virtual functions (10.3) and no virtual
   1251   //     base classes (10.1), and
   1252   //    the constructor selected to copy/move each direct base
   1253   //     class subobject is trivial, and
   1254   //    for each non-static data member of X that is of class
   1255   //     type (or array thereof), the constructor selected
   1256   //     to copy/move that member is trivial;
   1257   // otherwise the copy/move constructor is non-trivial.
   1258   { int arr[T(__has_trivial_move_constructor(POD))]; }
   1259   { int arr[T(__has_trivial_move_constructor(Union))]; }
   1260   { int arr[T(__has_trivial_move_constructor(HasCons))]; }
   1261   { int arr[T(__has_trivial_move_constructor(HasStaticMemberMoveCtor))]; }
   1262   { int arr[T(__has_trivial_move_constructor(AllDeleted))]; }
   1263 
   1264   { int arr[F(__has_trivial_move_constructor(HasVirt))]; }
   1265   { int arr[F(__has_trivial_move_constructor(DerivesVirt))]; }
   1266   { int arr[F(__has_trivial_move_constructor(HasMoveCtor))]; }
   1267   { int arr[F(__has_trivial_move_constructor(DerivesHasMoveCtor))]; }
   1268   { int arr[F(__has_trivial_move_constructor(HasMemberMoveCtor))]; }
   1269 }
   1270 
   1271 void has_trivial_copy_constructor() {
   1272   { int arr[T(__has_trivial_copy(Int))]; }
   1273   { int arr[T(__has_trivial_copy(IntAr))]; }
   1274   { int arr[T(__has_trivial_copy(Union))]; }
   1275   { int arr[T(__has_trivial_copy(UnionAr))]; }
   1276   { int arr[T(__has_trivial_copy(POD))]; }
   1277   { int arr[T(__has_trivial_copy(Derives))]; }
   1278   { int arr[T(__has_trivial_copy(ConstIntAr))]; }
   1279   { int arr[T(__has_trivial_copy(ConstIntArAr))]; }
   1280   { int arr[T(__has_trivial_copy(HasDest))]; }
   1281   { int arr[T(__has_trivial_copy(HasPriv))]; }
   1282   { int arr[T(__has_trivial_copy(HasCons))]; }
   1283   { int arr[T(__has_trivial_copy(HasRef))]; }
   1284   { int arr[T(__has_trivial_copy(HasMove))]; }
   1285   { int arr[T(__has_trivial_copy(IntRef))]; }
   1286   { int arr[T(__has_trivial_copy(HasCopyAssign))]; }
   1287   { int arr[T(__has_trivial_copy(HasMoveAssign))]; }
   1288   { int arr[T(__has_trivial_copy(const Int))]; }
   1289   { int arr[T(__has_trivial_copy(AllDefaulted))]; }
   1290   { int arr[T(__has_trivial_copy(AllDeleted))]; }
   1291   { int arr[T(__has_trivial_copy(DerivesAr))]; }
   1292   { int arr[T(__has_trivial_copy(DerivesHasRef))]; }
   1293 
   1294   { int arr[F(__has_trivial_copy(HasCopy))]; }
   1295   { int arr[F(__has_trivial_copy(HasTemplateCons))]; }
   1296   { int arr[F(__has_trivial_copy(VirtAr))]; }
   1297   { int arr[F(__has_trivial_copy(void))]; }
   1298   { int arr[F(__has_trivial_copy(cvoid))]; }
   1299   { int arr[F(__has_trivial_copy(AllPrivate))]; }
   1300   { int arr[F(__has_trivial_copy(ExtDefaulted))]; }
   1301 }
   1302 
   1303 void has_trivial_copy_assignment() {
   1304   { int arr[T(__has_trivial_assign(Int))]; }
   1305   { int arr[T(__has_trivial_assign(IntAr))]; }
   1306   { int arr[T(__has_trivial_assign(Union))]; }
   1307   { int arr[T(__has_trivial_assign(UnionAr))]; }
   1308   { int arr[T(__has_trivial_assign(POD))]; }
   1309   { int arr[T(__has_trivial_assign(Derives))]; }
   1310   { int arr[T(__has_trivial_assign(HasDest))]; }
   1311   { int arr[T(__has_trivial_assign(HasPriv))]; }
   1312   { int arr[T(__has_trivial_assign(HasCons))]; }
   1313   { int arr[T(__has_trivial_assign(HasRef))]; }
   1314   { int arr[T(__has_trivial_assign(HasCopy))]; }
   1315   { int arr[T(__has_trivial_assign(HasMove))]; }
   1316   { int arr[T(__has_trivial_assign(HasMoveAssign))]; }
   1317   { int arr[T(__has_trivial_assign(AllDefaulted))]; }
   1318   { int arr[T(__has_trivial_assign(AllDeleted))]; }
   1319   { int arr[T(__has_trivial_assign(DerivesAr))]; }
   1320   { int arr[T(__has_trivial_assign(DerivesHasRef))]; }
   1321 
   1322   { int arr[F(__has_trivial_assign(IntRef))]; }
   1323   { int arr[F(__has_trivial_assign(HasCopyAssign))]; }
   1324   { int arr[F(__has_trivial_assign(const Int))]; }
   1325   { int arr[F(__has_trivial_assign(ConstIntAr))]; }
   1326   { int arr[F(__has_trivial_assign(ConstIntArAr))]; }
   1327   { int arr[F(__has_trivial_assign(VirtAr))]; }
   1328   { int arr[F(__has_trivial_assign(void))]; }
   1329   { int arr[F(__has_trivial_assign(cvoid))]; }
   1330   { int arr[F(__has_trivial_assign(AllPrivate))]; }
   1331   { int arr[F(__has_trivial_assign(ExtDefaulted))]; }
   1332 }
   1333 
   1334 void has_trivial_destructor() {
   1335   { int arr[T(__has_trivial_destructor(Int))]; }
   1336   { int arr[T(__has_trivial_destructor(IntAr))]; }
   1337   { int arr[T(__has_trivial_destructor(Union))]; }
   1338   { int arr[T(__has_trivial_destructor(UnionAr))]; }
   1339   { int arr[T(__has_trivial_destructor(POD))]; }
   1340   { int arr[T(__has_trivial_destructor(Derives))]; }
   1341   { int arr[T(__has_trivial_destructor(ConstIntAr))]; }
   1342   { int arr[T(__has_trivial_destructor(ConstIntArAr))]; }
   1343   { int arr[T(__has_trivial_destructor(HasPriv))]; }
   1344   { int arr[T(__has_trivial_destructor(HasCons))]; }
   1345   { int arr[T(__has_trivial_destructor(HasRef))]; }
   1346   { int arr[T(__has_trivial_destructor(HasCopy))]; }
   1347   { int arr[T(__has_trivial_destructor(HasMove))]; }
   1348   { int arr[T(__has_trivial_destructor(IntRef))]; }
   1349   { int arr[T(__has_trivial_destructor(HasCopyAssign))]; }
   1350   { int arr[T(__has_trivial_destructor(HasMoveAssign))]; }
   1351   { int arr[T(__has_trivial_destructor(const Int))]; }
   1352   { int arr[T(__has_trivial_destructor(DerivesAr))]; }
   1353   { int arr[T(__has_trivial_destructor(VirtAr))]; }
   1354   { int arr[T(__has_trivial_destructor(AllDefaulted))]; }
   1355   { int arr[T(__has_trivial_destructor(AllDeleted))]; }
   1356   { int arr[T(__has_trivial_destructor(DerivesHasRef))]; }
   1357 
   1358   { int arr[F(__has_trivial_destructor(HasDest))]; }
   1359   { int arr[F(__has_trivial_destructor(void))]; }
   1360   { int arr[F(__has_trivial_destructor(cvoid))]; }
   1361   { int arr[F(__has_trivial_destructor(AllPrivate))]; }
   1362   { int arr[F(__has_trivial_destructor(ExtDefaulted))]; }
   1363 }
   1364 
   1365 struct A { ~A() {} };
   1366 template<typename> struct B : A { };
   1367 
   1368 void f() {
   1369   { int arr[F(__has_trivial_destructor(A))]; }
   1370   { int arr[F(__has_trivial_destructor(B<int>))]; }
   1371 }
   1372 
   1373 class PR11110 {
   1374   template <int> int operator=( int );
   1375   int operator=(PR11110);
   1376 };
   1377 
   1378 class UsingAssign;
   1379 
   1380 class UsingAssignBase {
   1381 protected:
   1382   UsingAssign &operator=(const UsingAssign&) throw();
   1383 };
   1384 
   1385 class UsingAssign : public UsingAssignBase {
   1386 public:
   1387   using UsingAssignBase::operator=;
   1388 };
   1389 
   1390 void has_nothrow_assign() {
   1391   { int arr[T(__has_nothrow_assign(Int))]; }
   1392   { int arr[T(__has_nothrow_assign(IntAr))]; }
   1393   { int arr[T(__has_nothrow_assign(Union))]; }
   1394   { int arr[T(__has_nothrow_assign(UnionAr))]; }
   1395   { int arr[T(__has_nothrow_assign(POD))]; }
   1396   { int arr[T(__has_nothrow_assign(Derives))]; }
   1397   { int arr[T(__has_nothrow_assign(HasDest))]; }
   1398   { int arr[T(__has_nothrow_assign(HasPriv))]; }
   1399   { int arr[T(__has_nothrow_assign(HasCons))]; }
   1400   { int arr[T(__has_nothrow_assign(HasRef))]; }
   1401   { int arr[T(__has_nothrow_assign(HasCopy))]; }
   1402   { int arr[T(__has_nothrow_assign(HasMove))]; }
   1403   { int arr[T(__has_nothrow_assign(HasMoveAssign))]; }
   1404   { int arr[T(__has_nothrow_assign(HasNoThrowCopyAssign))]; }
   1405   { int arr[T(__has_nothrow_assign(HasMultipleNoThrowCopyAssign))]; }
   1406   { int arr[T(__has_nothrow_assign(HasVirtDest))]; }
   1407   { int arr[T(__has_nothrow_assign(AllPrivate))]; }
   1408   { int arr[T(__has_nothrow_assign(UsingAssign))]; }
   1409   { int arr[T(__has_nothrow_assign(DerivesAr))]; }
   1410 
   1411   { int arr[F(__has_nothrow_assign(IntRef))]; }
   1412   { int arr[F(__has_nothrow_assign(HasCopyAssign))]; }
   1413   { int arr[F(__has_nothrow_assign(HasMultipleCopyAssign))]; }
   1414   { int arr[F(__has_nothrow_assign(const Int))]; }
   1415   { int arr[F(__has_nothrow_assign(ConstIntAr))]; }
   1416   { int arr[F(__has_nothrow_assign(ConstIntArAr))]; }
   1417   { int arr[F(__has_nothrow_assign(VirtAr))]; }
   1418   { int arr[F(__has_nothrow_assign(void))]; }
   1419   { int arr[F(__has_nothrow_assign(cvoid))]; }
   1420   { int arr[F(__has_nothrow_assign(PR11110))]; }
   1421 }
   1422 
   1423 void has_nothrow_move_assign() {
   1424   { int arr[T(__has_nothrow_move_assign(Int))]; }
   1425   { int arr[T(__has_nothrow_move_assign(Enum))]; }
   1426   { int arr[T(__has_nothrow_move_assign(Int*))]; }
   1427   { int arr[T(__has_nothrow_move_assign(Enum POD::*))]; }
   1428   { int arr[T(__has_nothrow_move_assign(POD))]; }
   1429   { int arr[T(__has_nothrow_move_assign(HasPriv))]; }
   1430   { int arr[T(__has_nothrow_move_assign(HasNoThrowMoveAssign))]; }
   1431   { int arr[T(__has_nothrow_move_assign(HasNoExceptNoThrowMoveAssign))]; }
   1432   { int arr[T(__has_nothrow_move_assign(HasMemberNoThrowMoveAssign))]; }
   1433   { int arr[T(__has_nothrow_move_assign(HasMemberNoExceptNoThrowMoveAssign))]; }
   1434   { int arr[T(__has_nothrow_move_assign(AllDeleted))]; }
   1435 
   1436 
   1437   { int arr[F(__has_nothrow_move_assign(HasThrowMoveAssign))]; }
   1438   { int arr[F(__has_nothrow_move_assign(HasNoExceptFalseMoveAssign))]; }
   1439   { int arr[F(__has_nothrow_move_assign(HasMemberThrowMoveAssign))]; }
   1440   { int arr[F(__has_nothrow_move_assign(HasMemberNoExceptFalseMoveAssign))]; }
   1441   { int arr[F(__has_nothrow_move_assign(NoDefaultMoveAssignDueToUDCopyCtor))]; }
   1442   { int arr[F(__has_nothrow_move_assign(NoDefaultMoveAssignDueToUDCopyAssign))]; }
   1443   { int arr[F(__has_nothrow_move_assign(NoDefaultMoveAssignDueToDtor))]; }
   1444 }
   1445 
   1446 void has_trivial_move_assign() {
   1447   // n3376 12.8 [class.copy]/25
   1448   // A copy/move assignment operator for class X is trivial if it
   1449   // is not user-provided, its declared parameter type is the same
   1450   // as if it had been implicitly declared, and if:
   1451   //   class X has no virtual functions (10.3) and no virtual base
   1452   //    classes (10.1), and
   1453   //   the assignment operator selected to copy/move each direct
   1454   //    base class subobject is trivial, and
   1455   //   for each non-static data member of X that is of class type
   1456   //    (or array thereof), the assignment operator
   1457   //    selected to copy/move that member is trivial;
   1458   { int arr[T(__has_trivial_move_assign(Int))]; }
   1459   { int arr[T(__has_trivial_move_assign(HasStaticMemberMoveAssign))]; }
   1460   { int arr[T(__has_trivial_move_assign(AllDeleted))]; }
   1461 
   1462   { int arr[F(__has_trivial_move_assign(HasVirt))]; }
   1463   { int arr[F(__has_trivial_move_assign(DerivesVirt))]; }
   1464   { int arr[F(__has_trivial_move_assign(HasMoveAssign))]; }
   1465   { int arr[F(__has_trivial_move_assign(DerivesHasMoveAssign))]; }
   1466   { int arr[F(__has_trivial_move_assign(HasMemberMoveAssign))]; }
   1467   { int arr[F(__has_nothrow_move_assign(NoDefaultMoveAssignDueToUDCopyCtor))]; }
   1468   { int arr[F(__has_nothrow_move_assign(NoDefaultMoveAssignDueToUDCopyAssign))]; }
   1469 }
   1470 
   1471 void has_nothrow_copy() {
   1472   { int arr[T(__has_nothrow_copy(Int))]; }
   1473   { int arr[T(__has_nothrow_copy(IntAr))]; }
   1474   { int arr[T(__has_nothrow_copy(Union))]; }
   1475   { int arr[T(__has_nothrow_copy(UnionAr))]; }
   1476   { int arr[T(__has_nothrow_copy(POD))]; }
   1477   { int arr[T(__has_nothrow_copy(const Int))]; }
   1478   { int arr[T(__has_nothrow_copy(ConstIntAr))]; }
   1479   { int arr[T(__has_nothrow_copy(ConstIntArAr))]; }
   1480   { int arr[T(__has_nothrow_copy(Derives))]; }
   1481   { int arr[T(__has_nothrow_copy(IntRef))]; }
   1482   { int arr[T(__has_nothrow_copy(HasDest))]; }
   1483   { int arr[T(__has_nothrow_copy(HasPriv))]; }
   1484   { int arr[T(__has_nothrow_copy(HasCons))]; }
   1485   { int arr[T(__has_nothrow_copy(HasRef))]; }
   1486   { int arr[T(__has_nothrow_copy(HasMove))]; }
   1487   { int arr[T(__has_nothrow_copy(HasCopyAssign))]; }
   1488   { int arr[T(__has_nothrow_copy(HasMoveAssign))]; }
   1489   { int arr[T(__has_nothrow_copy(HasNoThrowCopy))]; }
   1490   { int arr[T(__has_nothrow_copy(HasMultipleNoThrowCopy))]; }
   1491   { int arr[T(__has_nothrow_copy(HasVirtDest))]; }
   1492   { int arr[T(__has_nothrow_copy(HasTemplateCons))]; }
   1493   { int arr[T(__has_nothrow_copy(AllPrivate))]; }
   1494   { int arr[T(__has_nothrow_copy(DerivesAr))]; }
   1495 
   1496   { int arr[F(__has_nothrow_copy(HasCopy))]; }
   1497   { int arr[F(__has_nothrow_copy(HasMultipleCopy))]; }
   1498   { int arr[F(__has_nothrow_copy(VirtAr))]; }
   1499   { int arr[F(__has_nothrow_copy(void))]; }
   1500   { int arr[F(__has_nothrow_copy(cvoid))]; }
   1501 }
   1502 
   1503 void has_nothrow_constructor() {
   1504   { int arr[T(__has_nothrow_constructor(Int))]; }
   1505   { int arr[T(__has_nothrow_constructor(IntAr))]; }
   1506   { int arr[T(__has_nothrow_constructor(Union))]; }
   1507   { int arr[T(__has_nothrow_constructor(UnionAr))]; }
   1508   { int arr[T(__has_nothrow_constructor(POD))]; }
   1509   { int arr[T(__has_nothrow_constructor(Derives))]; }
   1510   { int arr[T(__has_nothrow_constructor(DerivesAr))]; }
   1511   { int arr[T(__has_nothrow_constructor(ConstIntAr))]; }
   1512   { int arr[T(__has_nothrow_constructor(ConstIntArAr))]; }
   1513   { int arr[T(__has_nothrow_constructor(HasDest))]; }
   1514   { int arr[T(__has_nothrow_constructor(HasPriv))]; }
   1515   { int arr[T(__has_nothrow_constructor(HasCopyAssign))]; }
   1516   { int arr[T(__has_nothrow_constructor(const Int))]; }
   1517   { int arr[T(__has_nothrow_constructor(HasNoThrowConstructor))]; }
   1518   { int arr[T(__has_nothrow_constructor(HasVirtDest))]; }
   1519   // { int arr[T(__has_nothrow_constructor(VirtAr))]; } // not implemented
   1520   { int arr[T(__has_nothrow_constructor(AllPrivate))]; }
   1521 
   1522   { int arr[F(__has_nothrow_constructor(HasCons))]; }
   1523   { int arr[F(__has_nothrow_constructor(HasRef))]; }
   1524   { int arr[F(__has_nothrow_constructor(HasCopy))]; }
   1525   { int arr[F(__has_nothrow_constructor(HasMove))]; }
   1526   { int arr[F(__has_nothrow_constructor(HasNoThrowConstructorWithArgs))]; }
   1527   { int arr[F(__has_nothrow_constructor(IntRef))]; }
   1528   { int arr[F(__has_nothrow_constructor(void))]; }
   1529   { int arr[F(__has_nothrow_constructor(cvoid))]; }
   1530   { int arr[F(__has_nothrow_constructor(HasTemplateCons))]; }
   1531 }
   1532 
   1533 void has_virtual_destructor() {
   1534   { int arr[F(__has_virtual_destructor(Int))]; }
   1535   { int arr[F(__has_virtual_destructor(IntAr))]; }
   1536   { int arr[F(__has_virtual_destructor(Union))]; }
   1537   { int arr[F(__has_virtual_destructor(UnionAr))]; }
   1538   { int arr[F(__has_virtual_destructor(POD))]; }
   1539   { int arr[F(__has_virtual_destructor(Derives))]; }
   1540   { int arr[F(__has_virtual_destructor(DerivesAr))]; }
   1541   { int arr[F(__has_virtual_destructor(const Int))]; }
   1542   { int arr[F(__has_virtual_destructor(ConstIntAr))]; }
   1543   { int arr[F(__has_virtual_destructor(ConstIntArAr))]; }
   1544   { int arr[F(__has_virtual_destructor(HasDest))]; }
   1545   { int arr[F(__has_virtual_destructor(HasPriv))]; }
   1546   { int arr[F(__has_virtual_destructor(HasCons))]; }
   1547   { int arr[F(__has_virtual_destructor(HasRef))]; }
   1548   { int arr[F(__has_virtual_destructor(HasCopy))]; }
   1549   { int arr[F(__has_virtual_destructor(HasMove))]; }
   1550   { int arr[F(__has_virtual_destructor(HasCopyAssign))]; }
   1551   { int arr[F(__has_virtual_destructor(HasMoveAssign))]; }
   1552   { int arr[F(__has_virtual_destructor(IntRef))]; }
   1553   { int arr[F(__has_virtual_destructor(VirtAr))]; }
   1554 
   1555   { int arr[T(__has_virtual_destructor(HasVirtDest))]; }
   1556   { int arr[T(__has_virtual_destructor(DerivedVirtDest))]; }
   1557   { int arr[F(__has_virtual_destructor(VirtDestAr))]; }
   1558   { int arr[F(__has_virtual_destructor(void))]; }
   1559   { int arr[F(__has_virtual_destructor(cvoid))]; }
   1560   { int arr[F(__has_virtual_destructor(AllPrivate))]; }
   1561 }
   1562 
   1563 
   1564 class Base {};
   1565 class Derived : Base {};
   1566 class Derived2a : Derived {};
   1567 class Derived2b : Derived {};
   1568 class Derived3 : virtual Derived2a, virtual Derived2b {};
   1569 template<typename T> struct BaseA { T a;  };
   1570 template<typename T> struct DerivedB : BaseA<T> { };
   1571 template<typename T> struct CrazyDerived : T { };
   1572 
   1573 
   1574 class class_forward; // expected-note {{forward declaration of 'class_forward'}}
   1575 
   1576 template <typename Base, typename Derived>
   1577 void isBaseOfT() {
   1578   int t[T(__is_base_of(Base, Derived))];
   1579 };
   1580 template <typename Base, typename Derived>
   1581 void isBaseOfF() {
   1582   int t[F(__is_base_of(Base, Derived))];
   1583 };
   1584 
   1585 template <class T> class DerivedTemp : Base {};
   1586 template <class T> class NonderivedTemp {};
   1587 template <class T> class UndefinedTemp; // expected-note {{declared here}}
   1588 
   1589 void is_base_of() {
   1590   { int arr[T(__is_base_of(Base, Derived))]; }
   1591   { int arr[T(__is_base_of(const Base, Derived))]; }
   1592   { int arr[F(__is_base_of(Derived, Base))]; }
   1593   { int arr[F(__is_base_of(Derived, int))]; }
   1594   { int arr[T(__is_base_of(Base, Base))]; }
   1595   { int arr[T(__is_base_of(Base, Derived3))]; }
   1596   { int arr[T(__is_base_of(Derived, Derived3))]; }
   1597   { int arr[T(__is_base_of(Derived2b, Derived3))]; }
   1598   { int arr[T(__is_base_of(Derived2a, Derived3))]; }
   1599   { int arr[T(__is_base_of(BaseA<int>, DerivedB<int>))]; }
   1600   { int arr[F(__is_base_of(DerivedB<int>, BaseA<int>))]; }
   1601   { int arr[T(__is_base_of(Base, CrazyDerived<Base>))]; }
   1602   { int arr[F(__is_base_of(Union, Union))]; }
   1603   { int arr[T(__is_base_of(Empty, Empty))]; }
   1604   { int arr[T(__is_base_of(class_forward, class_forward))]; }
   1605   { int arr[F(__is_base_of(Empty, class_forward))]; } // expected-error {{incomplete type 'class_forward' used in type trait expression}}
   1606   { int arr[F(__is_base_of(Base&, Derived&))]; }
   1607   int t18[F(__is_base_of(Base[10], Derived[10]))];
   1608   { int arr[F(__is_base_of(int, int))]; }
   1609   { int arr[F(__is_base_of(long, int))]; }
   1610   { int arr[T(__is_base_of(Base, DerivedTemp<int>))]; }
   1611   { int arr[F(__is_base_of(Base, NonderivedTemp<int>))]; }
   1612   { int arr[F(__is_base_of(Base, UndefinedTemp<int>))]; } // expected-error {{implicit instantiation of undefined template 'UndefinedTemp<int>'}}
   1613 
   1614   isBaseOfT<Base, Derived>();
   1615   isBaseOfF<Derived, Base>();
   1616 
   1617   isBaseOfT<Base, CrazyDerived<Base> >();
   1618   isBaseOfF<CrazyDerived<Base>, Base>();
   1619 
   1620   isBaseOfT<BaseA<int>, DerivedB<int> >();
   1621   isBaseOfF<DerivedB<int>, BaseA<int> >();
   1622 }
   1623 
   1624 template<class T, class U>
   1625 class TemplateClass {};
   1626 
   1627 template<class T>
   1628 using TemplateAlias = TemplateClass<T, int>;
   1629 
   1630 typedef class Base BaseTypedef;
   1631 
   1632 void is_same()
   1633 {
   1634   int t01[T(__is_same(Base, Base))];
   1635   int t02[T(__is_same(Base, BaseTypedef))];
   1636   int t03[T(__is_same(TemplateClass<int, int>, TemplateAlias<int>))];
   1637 
   1638   int t10[F(__is_same(Base, const Base))];
   1639   int t11[F(__is_same(Base, Base&))];
   1640   int t12[F(__is_same(Base, Derived))];
   1641 }
   1642 
   1643 struct IntWrapper
   1644 {
   1645   int value;
   1646   IntWrapper(int _value) : value(_value) {}
   1647   operator int() const {
   1648     return value;
   1649   }
   1650 };
   1651 
   1652 struct FloatWrapper
   1653 {
   1654   float value;
   1655   FloatWrapper(float _value) : value(_value) {}
   1656   FloatWrapper(const IntWrapper& obj)
   1657     : value(static_cast<float>(obj.value)) {}
   1658   operator float() const {
   1659     return value;
   1660   }
   1661   operator IntWrapper() const {
   1662     return IntWrapper(static_cast<int>(value));
   1663   }
   1664 };
   1665 
   1666 void is_convertible()
   1667 {
   1668   int t01[T(__is_convertible(IntWrapper, IntWrapper))];
   1669   int t02[T(__is_convertible(IntWrapper, const IntWrapper))];
   1670   int t03[T(__is_convertible(IntWrapper, int))];
   1671   int t04[T(__is_convertible(int, IntWrapper))];
   1672   int t05[T(__is_convertible(IntWrapper, FloatWrapper))];
   1673   int t06[T(__is_convertible(FloatWrapper, IntWrapper))];
   1674   int t07[T(__is_convertible(FloatWrapper, float))];
   1675   int t08[T(__is_convertible(float, FloatWrapper))];
   1676 }
   1677 
   1678 struct FromInt { FromInt(int); };
   1679 struct ToInt { operator int(); };
   1680 typedef void Function();
   1681 
   1682 void is_convertible_to();
   1683 class PrivateCopy {
   1684   PrivateCopy(const PrivateCopy&);
   1685   friend void is_convertible_to();
   1686 };
   1687 
   1688 template<typename T>
   1689 struct X0 {
   1690   template<typename U> X0(const X0<U>&);
   1691 };
   1692 
   1693 struct Abstract { virtual void f() = 0; };
   1694 
   1695 void is_convertible_to() {
   1696   { int arr[T(__is_convertible_to(Int, Int))]; }
   1697   { int arr[F(__is_convertible_to(Int, IntAr))]; }
   1698   { int arr[F(__is_convertible_to(IntAr, IntAr))]; }
   1699   { int arr[T(__is_convertible_to(void, void))]; }
   1700   { int arr[T(__is_convertible_to(cvoid, void))]; }
   1701   { int arr[T(__is_convertible_to(void, cvoid))]; }
   1702   { int arr[T(__is_convertible_to(cvoid, cvoid))]; }
   1703   { int arr[T(__is_convertible_to(int, FromInt))]; }
   1704   { int arr[T(__is_convertible_to(long, FromInt))]; }
   1705   { int arr[T(__is_convertible_to(double, FromInt))]; }
   1706   { int arr[T(__is_convertible_to(const int, FromInt))]; }
   1707   { int arr[T(__is_convertible_to(const int&, FromInt))]; }
   1708   { int arr[T(__is_convertible_to(ToInt, int))]; }
   1709   { int arr[T(__is_convertible_to(ToInt, const int&))]; }
   1710   { int arr[T(__is_convertible_to(ToInt, long))]; }
   1711   { int arr[F(__is_convertible_to(ToInt, int&))]; }
   1712   { int arr[F(__is_convertible_to(ToInt, FromInt))]; }
   1713   { int arr[T(__is_convertible_to(IntAr&, IntAr&))]; }
   1714   { int arr[T(__is_convertible_to(IntAr&, const IntAr&))]; }
   1715   { int arr[F(__is_convertible_to(const IntAr&, IntAr&))]; }
   1716   { int arr[F(__is_convertible_to(Function, Function))]; }
   1717   { int arr[F(__is_convertible_to(PrivateCopy, PrivateCopy))]; }
   1718   { int arr[T(__is_convertible_to(X0<int>, X0<float>))]; }
   1719   { int arr[F(__is_convertible_to(Abstract, Abstract))]; }
   1720 }
   1721 
   1722 namespace is_convertible_to_instantiate {
   1723   // Make sure we don't try to instantiate the constructor.
   1724   template<int x> class A { A(int) { int a[x]; } };
   1725   int x = __is_convertible_to(int, A<-1>);
   1726 }
   1727 
   1728 void is_trivial()
   1729 {
   1730   { int arr[T(__is_trivial(int))]; }
   1731   { int arr[T(__is_trivial(Enum))]; }
   1732   { int arr[T(__is_trivial(POD))]; }
   1733   { int arr[T(__is_trivial(Int))]; }
   1734   { int arr[T(__is_trivial(IntAr))]; }
   1735   { int arr[T(__is_trivial(IntArNB))]; }
   1736   { int arr[T(__is_trivial(Statics))]; }
   1737   { int arr[T(__is_trivial(Empty))]; }
   1738   { int arr[T(__is_trivial(EmptyUnion))]; }
   1739   { int arr[T(__is_trivial(Union))]; }
   1740   { int arr[T(__is_trivial(Derives))]; }
   1741   { int arr[T(__is_trivial(DerivesAr))]; }
   1742   { int arr[T(__is_trivial(DerivesArNB))]; }
   1743   { int arr[T(__is_trivial(DerivesEmpty))]; }
   1744   { int arr[T(__is_trivial(HasFunc))]; }
   1745   { int arr[T(__is_trivial(HasOp))]; }
   1746   { int arr[T(__is_trivial(HasConv))]; }
   1747   { int arr[T(__is_trivial(HasAssign))]; }
   1748   { int arr[T(__is_trivial(HasAnonymousUnion))]; }
   1749   { int arr[T(__is_trivial(HasPriv))]; }
   1750   { int arr[T(__is_trivial(HasProt))]; }
   1751   { int arr[T(__is_trivial(DerivesHasPriv))]; }
   1752   { int arr[T(__is_trivial(DerivesHasProt))]; }
   1753   { int arr[T(__is_trivial(Vector))]; }
   1754   { int arr[T(__is_trivial(VectorExt))]; }
   1755 
   1756   { int arr[F(__is_trivial(HasCons))]; }
   1757   { int arr[F(__is_trivial(HasCopyAssign))]; }
   1758   { int arr[F(__is_trivial(HasMoveAssign))]; }
   1759   { int arr[F(__is_trivial(HasDest))]; }
   1760   { int arr[F(__is_trivial(HasRef))]; }
   1761   { int arr[F(__is_trivial(HasNonPOD))]; }
   1762   { int arr[F(__is_trivial(HasVirt))]; }
   1763   { int arr[F(__is_trivial(DerivesHasCons))]; }
   1764   { int arr[F(__is_trivial(DerivesHasCopyAssign))]; }
   1765   { int arr[F(__is_trivial(DerivesHasMoveAssign))]; }
   1766   { int arr[F(__is_trivial(DerivesHasDest))]; }
   1767   { int arr[F(__is_trivial(DerivesHasRef))]; }
   1768   { int arr[F(__is_trivial(DerivesHasVirt))]; }
   1769   { int arr[F(__is_trivial(void))]; }
   1770   { int arr[F(__is_trivial(cvoid))]; }
   1771 }
   1772 
   1773 void trivial_checks()
   1774 {
   1775   { int arr[T(__is_trivially_copyable(int))]; }
   1776   { int arr[T(__is_trivially_copyable(Enum))]; }
   1777   { int arr[T(__is_trivially_copyable(POD))]; }
   1778   { int arr[T(__is_trivially_copyable(Int))]; }
   1779   { int arr[T(__is_trivially_copyable(IntAr))]; }
   1780   { int arr[T(__is_trivially_copyable(IntArNB))]; }
   1781   { int arr[T(__is_trivially_copyable(Statics))]; }
   1782   { int arr[T(__is_trivially_copyable(Empty))]; }
   1783   { int arr[T(__is_trivially_copyable(EmptyUnion))]; }
   1784   { int arr[T(__is_trivially_copyable(Union))]; }
   1785   { int arr[T(__is_trivially_copyable(Derives))]; }
   1786   { int arr[T(__is_trivially_copyable(DerivesAr))]; }
   1787   { int arr[T(__is_trivially_copyable(DerivesArNB))]; }
   1788   { int arr[T(__is_trivially_copyable(DerivesEmpty))]; }
   1789   { int arr[T(__is_trivially_copyable(HasFunc))]; }
   1790   { int arr[T(__is_trivially_copyable(HasOp))]; }
   1791   { int arr[T(__is_trivially_copyable(HasConv))]; }
   1792   { int arr[T(__is_trivially_copyable(HasAssign))]; }
   1793   { int arr[T(__is_trivially_copyable(HasAnonymousUnion))]; }
   1794   { int arr[T(__is_trivially_copyable(HasPriv))]; }
   1795   { int arr[T(__is_trivially_copyable(HasProt))]; }
   1796   { int arr[T(__is_trivially_copyable(DerivesHasPriv))]; }
   1797   { int arr[T(__is_trivially_copyable(DerivesHasProt))]; }
   1798   { int arr[T(__is_trivially_copyable(Vector))]; }
   1799   { int arr[T(__is_trivially_copyable(VectorExt))]; }
   1800   { int arr[T(__is_trivially_copyable(HasCons))]; }
   1801   { int arr[T(__is_trivially_copyable(HasRef))]; }
   1802   { int arr[T(__is_trivially_copyable(HasNonPOD))]; }
   1803   { int arr[T(__is_trivially_copyable(DerivesHasCons))]; }
   1804   { int arr[T(__is_trivially_copyable(DerivesHasRef))]; }
   1805 
   1806   { int arr[F(__is_trivially_copyable(HasCopyAssign))]; }
   1807   { int arr[F(__is_trivially_copyable(HasMoveAssign))]; }
   1808   { int arr[F(__is_trivially_copyable(HasDest))]; }
   1809   { int arr[F(__is_trivially_copyable(HasVirt))]; }
   1810   { int arr[F(__is_trivially_copyable(DerivesHasCopyAssign))]; }
   1811   { int arr[F(__is_trivially_copyable(DerivesHasMoveAssign))]; }
   1812   { int arr[F(__is_trivially_copyable(DerivesHasDest))]; }
   1813   { int arr[F(__is_trivially_copyable(DerivesHasVirt))]; }
   1814   { int arr[F(__is_trivially_copyable(void))]; }
   1815   { int arr[F(__is_trivially_copyable(cvoid))]; }
   1816 
   1817   { int arr[T((__is_trivially_constructible(int)))]; }
   1818   { int arr[T((__is_trivially_constructible(int, int)))]; }
   1819   { int arr[T((__is_trivially_constructible(int, float)))]; }
   1820   { int arr[T((__is_trivially_constructible(int, int&)))]; }
   1821   { int arr[T((__is_trivially_constructible(int, const int&)))]; }
   1822   { int arr[T((__is_trivially_constructible(int, int)))]; }
   1823   { int arr[T((__is_trivially_constructible(HasCopyAssign, HasCopyAssign)))]; }
   1824   { int arr[T((__is_trivially_constructible(HasCopyAssign, const HasCopyAssign&)))]; }
   1825   { int arr[T((__is_trivially_constructible(HasCopyAssign, HasCopyAssign&&)))]; }
   1826   { int arr[T((__is_trivially_constructible(HasCopyAssign)))]; }
   1827   { int arr[T((__is_trivially_constructible(NonTrivialDefault,
   1828                                             const NonTrivialDefault&)))]; }
   1829   { int arr[T((__is_trivially_constructible(NonTrivialDefault,
   1830                                             NonTrivialDefault&&)))]; }
   1831   { int arr[T((__is_trivially_constructible(AllDefaulted)))]; }
   1832   { int arr[T((__is_trivially_constructible(AllDefaulted,
   1833                                             const AllDefaulted &)))]; }
   1834   { int arr[T((__is_trivially_constructible(AllDefaulted,
   1835                                             AllDefaulted &&)))]; }
   1836 
   1837   { int arr[F((__is_trivially_constructible(int, int*)))]; }
   1838   { int arr[F((__is_trivially_constructible(NonTrivialDefault)))]; }
   1839   { int arr[F((__is_trivially_constructible(ThreeArgCtor, int*, char*, int&)))]; }
   1840   { int arr[F((__is_trivially_constructible(AllDeleted)))]; }
   1841   { int arr[F((__is_trivially_constructible(AllDeleted,
   1842                                             const AllDeleted &)))]; }
   1843   { int arr[F((__is_trivially_constructible(AllDeleted,
   1844                                             AllDeleted &&)))]; }
   1845   { int arr[F((__is_trivially_constructible(ExtDefaulted)))]; }
   1846   { int arr[F((__is_trivially_constructible(ExtDefaulted,
   1847                                             const ExtDefaulted &)))]; }
   1848   { int arr[F((__is_trivially_constructible(ExtDefaulted,
   1849                                             ExtDefaulted &&)))]; }
   1850 
   1851   { int arr[T((__is_trivially_assignable(int&, int)))]; }
   1852   { int arr[T((__is_trivially_assignable(int&, int&)))]; }
   1853   { int arr[T((__is_trivially_assignable(int&, int&&)))]; }
   1854   { int arr[T((__is_trivially_assignable(int&, const int&)))]; }
   1855   { int arr[T((__is_trivially_assignable(POD&, POD)))]; }
   1856   { int arr[T((__is_trivially_assignable(POD&, POD&)))]; }
   1857   { int arr[T((__is_trivially_assignable(POD&, POD&&)))]; }
   1858   { int arr[T((__is_trivially_assignable(POD&, const POD&)))]; }
   1859   { int arr[T((__is_trivially_assignable(int*&, int*)))]; }
   1860   { int arr[T((__is_trivially_assignable(AllDefaulted,
   1861                                          const AllDefaulted &)))]; }
   1862   { int arr[T((__is_trivially_assignable(AllDefaulted,
   1863                                          AllDefaulted &&)))]; }
   1864 
   1865   { int arr[F((__is_trivially_assignable(int*&, float*)))]; }
   1866   { int arr[F((__is_trivially_assignable(HasCopyAssign&, HasCopyAssign)))]; }
   1867   { int arr[F((__is_trivially_assignable(HasCopyAssign&, HasCopyAssign&)))]; }
   1868   { int arr[F((__is_trivially_assignable(HasCopyAssign&, const HasCopyAssign&)))]; }
   1869   { int arr[F((__is_trivially_assignable(HasCopyAssign&, HasCopyAssign&&)))]; }
   1870   { int arr[F((__is_trivially_assignable(TrivialMoveButNotCopy&,
   1871                                         TrivialMoveButNotCopy&)))]; }
   1872   { int arr[F((__is_trivially_assignable(TrivialMoveButNotCopy&,
   1873                                         const TrivialMoveButNotCopy&)))]; }
   1874   { int arr[F((__is_trivially_assignable(AllDeleted,
   1875                                          const AllDeleted &)))]; }
   1876   { int arr[F((__is_trivially_assignable(AllDeleted,
   1877                                          AllDeleted &&)))]; }
   1878   { int arr[F((__is_trivially_assignable(ExtDefaulted,
   1879                                          const ExtDefaulted &)))]; }
   1880   { int arr[F((__is_trivially_assignable(ExtDefaulted,
   1881                                          ExtDefaulted &&)))]; }
   1882 
   1883   { int arr[T((__is_trivially_assignable(HasDefaultTrivialCopyAssign&,
   1884                                          HasDefaultTrivialCopyAssign&)))]; }
   1885   { int arr[T((__is_trivially_assignable(HasDefaultTrivialCopyAssign&,
   1886                                        const HasDefaultTrivialCopyAssign&)))]; }
   1887   { int arr[T((__is_trivially_assignable(TrivialMoveButNotCopy&,
   1888                                          TrivialMoveButNotCopy)))]; }
   1889   { int arr[T((__is_trivially_assignable(TrivialMoveButNotCopy&,
   1890                                          TrivialMoveButNotCopy&&)))]; }
   1891 }
   1892 
   1893 // Instantiation of __is_trivially_constructible
   1894 template<typename T, typename ...Args>
   1895 struct is_trivially_constructible {
   1896   static const bool value = __is_trivially_constructible(T, Args...);
   1897 };
   1898 
   1899 void is_trivially_constructible_test() {
   1900   { int arr[T((is_trivially_constructible<int>::value))]; }
   1901   { int arr[T((is_trivially_constructible<int, int>::value))]; }
   1902   { int arr[T((is_trivially_constructible<int, float>::value))]; }
   1903   { int arr[T((is_trivially_constructible<int, int&>::value))]; }
   1904   { int arr[T((is_trivially_constructible<int, const int&>::value))]; }
   1905   { int arr[T((is_trivially_constructible<int, int>::value))]; }
   1906   { int arr[T((is_trivially_constructible<HasCopyAssign, HasCopyAssign>::value))]; }
   1907   { int arr[T((is_trivially_constructible<HasCopyAssign, const HasCopyAssign&>::value))]; }
   1908   { int arr[T((is_trivially_constructible<HasCopyAssign, HasCopyAssign&&>::value))]; }
   1909   { int arr[T((is_trivially_constructible<HasCopyAssign>::value))]; }
   1910   { int arr[T((is_trivially_constructible<NonTrivialDefault,
   1911                                             const NonTrivialDefault&>::value))]; }
   1912   { int arr[T((is_trivially_constructible<NonTrivialDefault,
   1913                                             NonTrivialDefault&&>::value))]; }
   1914 
   1915   { int arr[F((is_trivially_constructible<int, int*>::value))]; }
   1916   { int arr[F((is_trivially_constructible<NonTrivialDefault>::value))]; }
   1917   { int arr[F((is_trivially_constructible<ThreeArgCtor, int*, char*, int&>::value))]; }
   1918 }
   1919 
   1920 void array_rank() {
   1921   int t01[T(__array_rank(IntAr) == 1)];
   1922   int t02[T(__array_rank(ConstIntArAr) == 2)];
   1923 }
   1924 
   1925 void array_extent() {
   1926   int t01[T(__array_extent(IntAr, 0) == 10)];
   1927   int t02[T(__array_extent(ConstIntArAr, 0) == 4)];
   1928   int t03[T(__array_extent(ConstIntArAr, 1) == 10)];
   1929 }
   1930