summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp17
1 files changed, 1 insertions, 16 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index d975a155cd7..d87752081b3 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -2438,22 +2438,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, UnaryTypeTrait UTT, QualType T,
case UTT_IsSigned:
return T->isSignedIntegerType();
case UTT_IsStandardLayout:
- // Error if T is an incomplete type.
- if (Self.RequireCompleteType(KeyLoc, T, diag::err_incomplete_typeid))
- return false;
-
- // A standard layout type is:
- // - a scalar type
- // - an array of standard layout types
- // - a standard layout class type:
- if (EvaluateUnaryTypeTrait(Self, UTT_IsScalar, T, KeyLoc))
- return true;
- if (EvaluateUnaryTypeTrait(Self, UTT_IsScalar, C.getBaseElementType(T),
- KeyLoc))
- return true;
- if (const RecordType *RT = C.getBaseElementType(T)->getAs<RecordType>())
- return RT->hasStandardLayout();
- return false;
+ return T->isStandardLayoutType();
case UTT_IsUnsigned:
return T->isUnsignedIntegerType();
case UTT_IsVoid:
OpenPOWER on IntegriCloud