diff options
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index b402d3f2da..7d9a33af11 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -4402,12 +4402,14 @@ QualType Sema::BuildUnaryTransformType(QualType BaseType, QualType Sema::BuildAtomicType(QualType T, SourceLocation Loc) { if (!T->isDependentType()) { + // FIXME: It isn't entirely clear whether incomplete atomic types + // are allowed or not; for simplicity, ban them for the moment. + if (RequireCompleteType(Loc, T, + PDiag(diag::err_atomic_specifier_bad_type) << 0)) + return QualType(); + int DisallowedKind = -1; - if (T->isIncompleteType()) - // FIXME: It isn't entirely clear whether incomplete atomic types - // are allowed or not; for simplicity, ban them for the moment. - DisallowedKind = 0; - else if (T->isArrayType()) + if (T->isArrayType()) DisallowedKind = 1; else if (T->isFunctionType()) DisallowedKind = 2; |