diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-04-23 20:51:42 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-04-23 20:51:42 +0000 |
commit | 43a56a0622917ae996244d76d5f20c4d31cc119c (patch) | |
tree | 19f0d4f91a15968e97f903832e3cb0b9d0afd6bf | |
parent | 34eaaa523c3820dd32bcd9530148e76e87dcfa90 (diff) |
Test POD and trivial type traits given a class derived from a generic
non-POD type.
It might be nicer to have a Derives* variant for each of HasCons,
HasCopy, etc. Then we could test each of those and also test the __has_*
traits. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130074 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/SemaCXX/type-traits.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/SemaCXX/type-traits.cpp b/test/SemaCXX/type-traits.cpp index a4b59fb39e..9255cdd13f 100644 --- a/test/SemaCXX/type-traits.cpp +++ b/test/SemaCXX/type-traits.cpp @@ -33,6 +33,7 @@ struct Derives : POD {}; 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(); }; @@ -99,6 +100,7 @@ void is_pod() { 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))]; } @@ -589,6 +591,7 @@ void is_trivial() { int arr[F(__is_trivial(HasVirt))]; } { 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))]; } } |