diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-04-05 00:34:54 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-04-05 00:34:54 +0000 |
commit | ae06c84ee2d866bd78e8d7c987bb57966940e33a (patch) | |
tree | fb58cf69b27dced7a941296a26bc97b25f796276 /clang/lib/Sema | |
parent | d6f7313c8f55d84f76284c20b3744f744e25797f (diff) | |
download | bcm5719-llvm-ae06c84ee2d866bd78e8d7c987bb57966940e33a.tar.gz bcm5719-llvm-ae06c84ee2d866bd78e8d7c987bb57966940e33a.zip |
Revert r328680 ("[ObjC] Make C++ triviality type traits available to non-trivial C structs.")
It unintentionally caused the values of the __has_* type traits to change in
C++ for trivially-copyable classes with volatile members.
llvm-svn: 329247
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 849fc3c3cf3..56b95c45aa0 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -4521,8 +4521,6 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, // does not correctly compute triviality in the presence of multiple special // members of the same kind. Revisit this once the g++ bug is fixed. case UTT_HasTrivialDefaultConstructor: - if (T.isNonTrivialToPrimitiveDefaultInitialize()) - return false; // http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html: // If __is_pod (type) is true then the trait is true, else if type is // a cv class or union type (or array thereof) with a trivial default @@ -4534,8 +4532,6 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, !RD->hasNonTrivialDefaultConstructor(); return false; case UTT_HasTrivialMoveConstructor: - if (T.isNonTrivialToPrimitiveDestructiveMove()) - return false; // This trait is implemented by MSVC 2012 and needed to parse the // standard library headers. Specifically this is used as the logic // behind std::is_trivially_move_constructible (20.9.4.3). @@ -4545,8 +4541,6 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, return RD->hasTrivialMoveConstructor() && !RD->hasNonTrivialMoveConstructor(); return false; case UTT_HasTrivialCopy: - if (T.isNonTrivialToPrimitiveCopy()) - return false; // http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html: // If __is_pod (type) is true or type is a reference type then // the trait is true, else if type is a cv class or union type @@ -4559,8 +4553,6 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, !RD->hasNonTrivialCopyConstructor(); return false; case UTT_HasTrivialMoveAssign: - if (T.isNonTrivialToPrimitiveDestructiveMove()) - return false; // This trait is implemented by MSVC 2012 and needed to parse the // standard library headers. Specifically it is used as the logic // behind std::is_trivially_move_assignable (20.9.4.3) @@ -4570,8 +4562,6 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, return RD->hasTrivialMoveAssignment() && !RD->hasNonTrivialMoveAssignment(); return false; case UTT_HasTrivialAssign: - if (T.isNonTrivialToPrimitiveCopy()) - return false; // http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html: // If type is const qualified or is a reference type then the // trait is false. Otherwise if __is_pod (type) is true then the @@ -4642,8 +4632,6 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, return true; case UTT_HasTrivialDestructor: - if (T.isDestructedType() == QualType::DK_nontrivial_c_struct) - return false; // http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html // If __is_pod (type) is true or type is a reference type // then the trait is true, else if type is a cv class or union |