}
bool Type::isLiteralType() const {
- if (isIncompleteType())
+ if (isDependentType())
return false;
// C++0x [basic.types]p10:
// -- an array of literal type
// Extension: variable arrays cannot be literal types, since they're
// runtime-sized.
- if (isArrayType() && !isConstantArrayType())
+ if (isVariableArrayType())
return false;
const Type *BaseTy = getBaseElementTypeUnsafe();
assert(BaseTy && "NULL element type");
+ // Return false for incomplete types after skipping any incomplete array
+ // types; those are expressly allowed by the standard and thus our API.
+ if (BaseTy->isIncompleteType())
+ return false;
+
// C++0x [basic.types]p10:
// A type is a literal type if it is:
// -- a scalar type; or
}
bool Type::isTrivialType() const {
- if (isIncompleteType())
+ if (isDependentType())
return false;
// C++0x [basic.types]p9:
// types.
const Type *BaseTy = getBaseElementTypeUnsafe();
assert(BaseTy && "NULL element type");
+
+ // Return false for incomplete types after skipping any incomplete array
+ // types which are expressly allowed by the standard and thus our API.
+ if (BaseTy->isIncompleteType())
+ return false;
+
if (BaseTy->isScalarType()) return true;
if (const RecordType *RT = BaseTy->getAs<RecordType>()) {
if (const CXXRecordDecl *ClassDecl =
}
bool Type::isStandardLayoutType() const {
- if (isIncompleteType())
+ if (isDependentType())
return false;
// C++0x [basic.types]p9:
// standard-layout types.
const Type *BaseTy = getBaseElementTypeUnsafe();
assert(BaseTy && "NULL element type");
+
+ // Return false for incomplete types after skipping any incomplete array
+ // types which are expressly allowed by the standard and thus our API.
+ if (BaseTy->isIncompleteType())
+ return false;
+
if (BaseTy->isScalarType()) return true;
if (const RecordType *RT = BaseTy->getAs<RecordType>()) {
if (const CXXRecordDecl *ClassDecl =
// isStandardLayoutType. We implement it dircetly to avoid redundant
// conversions from a type to a CXXRecordDecl.
bool Type::isCXX11PODType() const {
- if (isIncompleteType())
+ if (isDependentType())
return false;
// C++11 [basic.types]p9:
// versions of these types are collectively called trivial types.
const Type *BaseTy = getBaseElementTypeUnsafe();
assert(BaseTy && "NULL element type");
+
+ // Return false for incomplete types after skipping any incomplete array
+ // types which are expressly allowed by the standard and thus our API.
+ if (BaseTy->isIncompleteType())
+ return false;
+
if (BaseTy->isScalarType()) return true;
if (const RecordType *RT = BaseTy->getAs<RecordType>()) {
if (const CXXRecordDecl *ClassDecl =
{ 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))]; }
{ 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))]; }
}