diff options
author | Erich Keane <erich.keane@intel.com> | 2017-12-12 16:02:06 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2017-12-12 16:02:06 +0000 |
commit | bd2197c0c1ad4e7ed648880a90a4ab16064942ae (patch) | |
tree | 59bad2bd44cd7a0cc7008930a3b7786391b36753 /clang/lib/AST/ASTContext.cpp | |
parent | fb68c48a8201a5d6066994699e098b267d4e418c (diff) | |
download | bcm5719-llvm-bd2197c0c1ad4e7ed648880a90a4ab16064942ae.tar.gz bcm5719-llvm-bd2197c0c1ad4e7ed648880a90a4ab16064942ae.zip |
Fix ICE when __has_unqiue_object_representations called with invalid decl
llvm-svn: 320489
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index e6471be2041..34a925020e8 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -2279,6 +2279,9 @@ bool ASTContext::hasUniqueObjectRepresentations(QualType Ty) const { if (Ty->isRecordType()) { const RecordDecl *Record = Ty->getAs<RecordType>()->getDecl(); + if (Record->isInvalidDecl()) + return false; + if (Record->isUnion()) return unionHasUniqueObjectRepresentations(*this, Record); |