From 43a56a0622917ae996244d76d5f20c4d31cc119c Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 23 Apr 2011 20:51:42 +0000 Subject: [PATCH] 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 --- test/SemaCXX/type-traits.cpp | 3 +++ 1 file changed, 3 insertions(+) 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))]; } } -- 2.40.0