aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-02-22 09:21:42 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-02-22 09:21:42 +0000
commit4da090394caafe7be5b66ad03409c06566444926 (patch)
tree2347f0abd27f8fe105a0fea8c0dcd530c70c5abf /lib/Sema/SemaDeclAttr.cpp
parent672edb0a04a5273e3a501f3b196844c125290780 (diff)
Don't crash if we try to apply 'alignas' to a variable declared with an
incomplete type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175880 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--lib/Sema/SemaDeclAttr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 8e2bac6ed0..5f6f81de14 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -3441,7 +3441,7 @@ void Sema::CheckAlignasUnderalignment(Decl *D) {
Ty = VD->getType();
else
Ty = Context.getTagDeclType(cast<TagDecl>(D));
- if (Ty->isDependentType())
+ if (Ty->isDependentType() || Ty->isIncompleteType())
return;
// C++11 [dcl.align]p5, C11 6.7.5/4: