aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-02-11 18:03:45 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-02-11 18:03:45 +0000
commit8327118ff60cd9c4812fba1e5ba4eb3cb5ed3401 (patch)
tree070c7f0d942fd14912b0ea42af505486d5623d88 /lib/Sema/SemaType.cpp
parentb141b285d17934a08d1cb0f5f0a5a4d65b2caab2 (diff)
Make sure to try instantiating a templated type which is used in an _Atomic
before complaining that it's incomplete. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150308 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp12
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;