Index: lib/Sema/SemaExprCXX.cpp =================================================================== --- lib/Sema/SemaExprCXX.cpp +++ lib/Sema/SemaExprCXX.cpp @@ -4113,9 +4113,16 @@ case UTT_HasTrivialCopy: case UTT_HasTrivialDestructor: case UTT_HasVirtualDestructor: - if (ArgTy->isIncompleteArrayType() || ArgTy->isVoidType()) + + if(ArgTy->isVoidType()) return true; + if (ArgTy->isIncompleteArrayType()) { + QualType ElTy = QualType(ArgTy->getBaseElementTypeUnsafe(), 0); + if (!ElTy->isIncompleteType()) + return true; + } + return !S.RequireCompleteType( Loc, ArgTy, diag::err_incomplete_type_used_in_type_trait_expr); } Index: test/SemaCXX/type-traits.cpp =================================================================== --- test/SemaCXX/type-traits.cpp +++ test/SemaCXX/type-traits.cpp @@ -2281,7 +2281,7 @@ { int arr[T(__is_destructible(ACompleteType))]; } { int arr[F(__is_destructible(AnIncompleteType))]; } // expected-error {{incomplete type}} - { int arr[F(__is_destructible(AnIncompleteType[]))]; } + { int arr[F(__is_destructible(AnIncompleteType[]))]; } // expected-error {{incomplete type}} { int arr[F(__is_destructible(AnIncompleteType[1]))]; } // expected-error {{incomplete type}} { int arr[F(__is_destructible(void))]; } { int arr[F(__is_destructible(const volatile void))]; } @@ -2304,7 +2304,7 @@ { int arr[T(__is_nothrow_destructible(ACompleteType))]; } { int arr[F(__is_nothrow_destructible(AnIncompleteType))]; } // expected-error {{incomplete type}} - { int arr[F(__is_nothrow_destructible(AnIncompleteType[]))]; } + { int arr[F(__is_nothrow_destructible(AnIncompleteType[]))]; } // expected-error {{incomplete type}} { int arr[F(__is_nothrow_destructible(AnIncompleteType[1]))]; } // expected-error {{incomplete type}} { int arr[F(__is_nothrow_destructible(void))]; } { int arr[F(__is_nothrow_destructible(const volatile void))]; } @@ -2326,7 +2326,7 @@ { int arr[T(__is_trivially_destructible(ACompleteType))]; } { int arr[F(__is_trivially_destructible(AnIncompleteType))]; } // expected-error {{incomplete type}} - { int arr[F(__is_trivially_destructible(AnIncompleteType[]))]; } + { int arr[F(__is_trivially_destructible(AnIncompleteType[]))]; } // expected-error {{incomplete type}} { int arr[F(__is_trivially_destructible(AnIncompleteType[1]))]; } // expected-error {{incomplete type}} { int arr[F(__is_trivially_destructible(void))]; } { int arr[F(__is_trivially_destructible(const volatile void))]; }