diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-22 09:21:42 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-22 09:21:42 +0000 |
commit | 4da090394caafe7be5b66ad03409c06566444926 (patch) | |
tree | 2347f0abd27f8fe105a0fea8c0dcd530c70c5abf /lib/Sema/SemaDeclAttr.cpp | |
parent | 672edb0a04a5273e3a501f3b196844c125290780 (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.cpp | 2 |
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: |