rsmith added inline comments.
================ Comment at: lib/Sema/SemaTemplateInstantiateDecl.cpp:4849 + DeclarationName Name = D->getDeclName(); + if (auto *DD = dyn_cast<CXXDestructorDecl>(D)) + Name = ---------------- ahatanak wrote: > rsmith wrote: > > Do we need to do this for conversion function names too? (Eg, `operator > > C1<T>*`) > I added a definition of "operator C1<T>*" and called it in C1::foo1. I didn't > see any crashes or asserts. > > Calls to a destructor and a conversion function create different AST nodes > (the former creates a MemberExpr and the latter creates a > CXXDependentScopeMemberExpr) and are transformed by different functions of > TreeTransform. Please also check in that testcase. ================ Comment at: lib/Sema/TreeTransform.h:2127 + + if (isa<CXXDestructorDecl>(FoundDecl)) + DNI = getDerived().TransformDeclarationNameInfo(MemberNameInfo); ---------------- I don't see any reason why this should be specific to destructors. But this is the wrong place for this change; by the time we reach `Rebuild*` we should have already transformed everything that we need to transform. Perhaps the problem is instead... ================ Comment at: lib/Sema/TreeTransform.h:11967-11969 TypeSourceInfo *DestroyedType = Destroyed.getTypeSourceInfo(); DeclarationName Name(SemaRef.Context.DeclarationNames.getCXXDestructorName( SemaRef.Context.getCanonicalType(DestroyedType->getType()))); ---------------- ... that we fail to transform `DestroyedType` here. Can you try fixing this bug and see if that removes the need for your other changes? https://reviews.llvm.org/D24969 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits