diff options
| author | Saleem Abdulrasool <compnerd@compnerd.org> | 2015-01-21 19:39:10 +0000 |
|---|---|---|
| committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2015-01-21 19:39:10 +0000 |
| commit | 97a01f016107e5037b03486bbae743c9639fe369 (patch) | |
| tree | a76dcbe7e5dda0218ba4f5e70eefd27e7816c76c | |
| parent | 2136ace9611da46844e2d3d53344c32ae9221050 (diff) | |
| download | bcm5719-llvm-97a01f016107e5037b03486bbae743c9639fe369.tar.gz bcm5719-llvm-97a01f016107e5037b03486bbae743c9639fe369.zip | |
Fix isTriviallyCopyableType for arrays
Fix isTriviallyCopyableType for arrays. An array of type T is trivially copyable
if T is trivially copyable.
Patch by Agustín Bergé!
llvm-svn: 226696
| -rw-r--r-- | clang/lib/AST/Type.cpp | 2 | ||||
| -rw-r--r-- | clang/test/SemaCXX/type-traits.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index 5a39ca0c6b4..cfa7389db6a 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -1089,7 +1089,7 @@ bool QualType::isTrivialType(ASTContext &Context) const { bool QualType::isTriviallyCopyableType(ASTContext &Context) const { if ((*this)->isArrayType()) - return Context.getBaseElementType(*this).isTrivialType(Context); + return Context.getBaseElementType(*this).isTriviallyCopyableType(Context); if (Context.getLangOpts().ObjCAutoRefCount) { switch (getObjCLifetime()) { diff --git a/clang/test/SemaCXX/type-traits.cpp b/clang/test/SemaCXX/type-traits.cpp index 4833c14b30b..2265c284763 100644 --- a/clang/test/SemaCXX/type-traits.cpp +++ b/clang/test/SemaCXX/type-traits.cpp @@ -1857,6 +1857,9 @@ void trivial_checks() { int arr[T(__is_trivially_copyable(HasNonPOD))]; } { int arr[T(__is_trivially_copyable(DerivesHasCons))]; } { int arr[T(__is_trivially_copyable(DerivesHasRef))]; } + { int arr[T(__is_trivially_copyable(NonTrivialDefault))]; } + { int arr[T(__is_trivially_copyable(NonTrivialDefault[]))]; } + { int arr[T(__is_trivially_copyable(NonTrivialDefault[3]))]; } { int arr[F(__is_trivially_copyable(HasCopyAssign))]; } { int arr[F(__is_trivially_copyable(HasMoveAssign))]; } |

