[PATCH] D82882: [ASTImporter] Fix AST import crash for a friend decl
Vince Bridgers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 30 14:09:47 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGecae672ac2ac: [ASTImporter] Fix AST import crash for a friend decl (authored by vabridgers, committed by einvbri <vince.a.bridgers at ericsson.com>).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82882/new/
https://reviews.llvm.org/D82882
Files:
clang/lib/AST/ASTImporterLookupTable.cpp
Index: clang/lib/AST/ASTImporterLookupTable.cpp
===================================================================
--- clang/lib/AST/ASTImporterLookupTable.cpp
+++ clang/lib/AST/ASTImporterLookupTable.cpp
@@ -45,7 +45,11 @@
LT.add(RTy->getAsCXXRecordDecl());
else if (const auto *SpecTy = dyn_cast<TemplateSpecializationType>(Ty))
LT.add(SpecTy->getAsCXXRecordDecl());
- else if (isa<TypedefType>(Ty)) {
+ else if (const auto *SubstTy =
+ dyn_cast<SubstTemplateTypeParmType>(Ty)) {
+ if (SubstTy->getAsCXXRecordDecl())
+ LT.add(SubstTy->getAsCXXRecordDecl());
+ } else if (isa<TypedefType>(Ty)) {
// We do not put friend typedefs to the lookup table because
// ASTImporter does not organize typedefs into redecl chains.
} else {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82882.274611.patch
Type: text/x-patch
Size: 853 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200630/3eb63b64/attachment.bin>
More information about the cfe-commits
mailing list