[cfe-commits] r130075 - /cfe/trunk/test/SemaCXX/type-traits.cpp

Chandler Carruth chandlerc at gmail.com
Sat Apr 23 14:02:37 PDT 2011


Author: chandlerc
Date: Sat Apr 23 16:02:37 2011
New Revision: 130075

URL: http://llvm.org/viewvc/llvm-project?rev=130075&view=rev
Log:
Flesh out these tests just a tad more. This provides targeted
'DerivesHasFoo' types for various non-POD constructs in the base class.
Only __is_pod and __is_trivial are wired up to these, not sure how much
more of this type of exhaustive testing is really interesting.

Modified:
    cfe/trunk/test/SemaCXX/type-traits.cpp

Modified: cfe/trunk/test/SemaCXX/type-traits.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/type-traits.cpp?rev=130075&r1=130074&r2=130075&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/type-traits.cpp (original)
+++ cfe/trunk/test/SemaCXX/type-traits.cpp Sat Apr 23 16:02:37 2011
@@ -33,7 +33,6 @@
 typedef Derives DerivesAr[10];
 typedef Derives DerivesArNB[];
 struct DerivesEmpty : Empty {};
-struct DerivesNonPOD : NonPOD {};
 struct HasCons { HasCons(int); };
 struct HasCopyAssign { HasCopyAssign operator =(const HasCopyAssign&); };
 struct HasDest { ~HasDest(); };
@@ -46,6 +45,13 @@
 typedef HasVirt VirtAr[10];
 typedef NonPOD NonPODArNB[];
 union NonPODUnion { int i; Derives n; };
+struct DerivesHasCons : HasCons {};
+struct DerivesHasCopyAssign : HasCopyAssign {};
+struct DerivesHasDest : HasDest {};
+struct DerivesHasPriv : HasPriv {};
+struct DerivesHasProt : HasProt {};
+struct DerivesHasRef : HasRef {};
+struct DerivesHasVirt : HasVirt {};
 
 struct HasNoThrowCopyAssign {
   void operator =(const HasNoThrowCopyAssign&) throw();
@@ -100,7 +106,6 @@
   { int arr[F(__is_pod(DerivesAr))]; }
   { int arr[F(__is_pod(DerivesArNB))]; }
   { int arr[F(__is_pod(DerivesEmpty))]; }
-  { int arr[F(__is_pod(DerivesNonPOD))]; }
   { int arr[F(__is_pod(HasCons))]; }
   { int arr[F(__is_pod(HasCopyAssign))]; }
   { int arr[F(__is_pod(HasDest))]; }
@@ -108,6 +113,13 @@
   { int arr[F(__is_pod(HasProt))]; }
   { int arr[F(__is_pod(HasRef))]; }
   { int arr[F(__is_pod(HasVirt))]; }
+  { int arr[F(__is_pod(DerivesHasCons))]; }
+  { int arr[F(__is_pod(DerivesHasCopyAssign))]; }
+  { int arr[F(__is_pod(DerivesHasDest))]; }
+  { int arr[F(__is_pod(DerivesHasPriv))]; }
+  { int arr[F(__is_pod(DerivesHasProt))]; }
+  { int arr[F(__is_pod(DerivesHasRef))]; }
+  { int arr[F(__is_pod(DerivesHasVirt))]; }
   { int arr[F(__is_pod(NonPOD))]; }
   { int arr[F(__is_pod(HasNonPOD))]; }
   { int arr[F(__is_pod(NonPODAr))]; }
@@ -582,6 +594,8 @@
   { int arr[T(__is_trivial(HasAnonymousUnion))]; }
   { int arr[T(__is_trivial(HasPriv))]; }
   { int arr[T(__is_trivial(HasProt))]; }
+  { int arr[T(__is_trivial(DerivesHasPriv))]; }
+  { int arr[T(__is_trivial(DerivesHasProt))]; }
 
   { int arr[F(__is_trivial(HasCons))]; }
   { int arr[F(__is_trivial(HasCopyAssign))]; }
@@ -589,9 +603,13 @@
   { int arr[F(__is_trivial(HasRef))]; }
   { int arr[F(__is_trivial(HasNonPOD))]; }
   { int arr[F(__is_trivial(HasVirt))]; }
+  { int arr[F(__is_trivial(DerivesHasCons))]; }
+  { int arr[F(__is_trivial(DerivesHasCopyAssign))]; }
+  { int arr[F(__is_trivial(DerivesHasDest))]; }
+  { int arr[F(__is_trivial(DerivesHasRef))]; }
+  { int arr[F(__is_trivial(DerivesHasVirt))]; }
   { int arr[F(__is_trivial(IntArNB))]; }
   { int arr[F(__is_trivial(DerivesArNB))]; }
-  { int arr[F(__is_trivial(DerivesNonPOD))]; }
   { int arr[F(__is_trivial(void))]; }
   { int arr[F(__is_trivial(cvoid))]; }
 }





More information about the cfe-commits mailing list