diff options
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); |