diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index dca05b41aee77..c04de4e132739 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -5316,7 +5316,8 @@ ASTContext::getTypedefType(ElaboratedTypeKeyword Keyword, } llvm::FoldingSetNodeID ID; - TypedefType::Profile(ID, Keyword, Qualifier, Decl, UnderlyingType); + TypedefType::Profile(ID, Keyword, Qualifier, Decl, + *TypeMatchesDeclOrNone ? QualType() : UnderlyingType); void *InsertPos = nullptr; if (FoldingSetPlaceholder *Placeholder =