aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/type-traits.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-04-30 10:31:50 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-04-30 10:31:50 +0000
commit018a088b3b30e500efa9173f7cd4b1b1f6a065a8 (patch)
treef0690a852e067c1b15cf1597da0dbfd6fd2fb88a /test/SemaCXX/type-traits.cpp
parenteb65a108bd1eb613ed2a9ebfdbd73a9c872f0309 (diff)
Switch the type-trait like APIs on the AST to only check for incomplete
types after looking through arrays. Arrays with an unknown bound seem to be specifically allowed in the library type traits in C++0x, and GCC's builtin __is_trivial returns 'true' for the type 'int[]'. Now Clang agrees with GCC about __is_trivial here. Also hardens these methods against dependent types by just returning false. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130605 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/type-traits.cpp')
-rw-r--r--test/SemaCXX/type-traits.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/SemaCXX/type-traits.cpp b/test/SemaCXX/type-traits.cpp
index 1dec7f923a..c45adecf66 100644
--- a/test/SemaCXX/type-traits.cpp
+++ b/test/SemaCXX/type-traits.cpp
@@ -1429,12 +1429,14 @@ void is_trivial()
{ int arr[T(__is_trivial(POD))]; }
{ int arr[T(__is_trivial(Int))]; }
{ int arr[T(__is_trivial(IntAr))]; }
+ { int arr[T(__is_trivial(IntArNB))]; }
{ int arr[T(__is_trivial(Statics))]; }
{ int arr[T(__is_trivial(Empty))]; }
{ int arr[T(__is_trivial(EmptyUnion))]; }
{ int arr[T(__is_trivial(Union))]; }
{ int arr[T(__is_trivial(Derives))]; }
{ int arr[T(__is_trivial(DerivesAr))]; }
+ { int arr[T(__is_trivial(DerivesArNB))]; }
{ int arr[T(__is_trivial(DerivesEmpty))]; }
{ int arr[T(__is_trivial(HasFunc))]; }
{ int arr[T(__is_trivial(HasOp))]; }
@@ -1459,8 +1461,6 @@ void is_trivial()
{ 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(void))]; }
{ int arr[F(__is_trivial(cvoid))]; }
}