martong added inline comments.

================
Comment at: clang/lib/AST/ASTStructuralEquivalence.cpp:965
     auto *Conversion2 = cast<CXXConversionDecl>(Method2);
-    if (Conversion1->isExplicit() != Conversion2->isExplicit())
+    if 
(!Conversion1->isEquivalentExplicit(Conversion2->getExplicitSpecifier()))
       return false;
----------------
martong wrote:
> Would it work if `Method1` has a different `ASTContext` than `Method2?
> That is exactly the case when we import an AST into another with ASTImporter.
`isEquivalentExplicit` calls `EquivalentExplicit`, which in turn calls 
`Stmt::Profile`.
Seems like `Stmt::Profile` relies on pointer equivalencies, however, here we 
may have two different `ASTContext`s for each Method, so we must not rely on 
pointer values.
I suggest to use a version of `EquivalentExplicit` which uses 
`Stmt::ProcessODRHash`, that one does not rely on pointer values.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60934/new/

https://reviews.llvm.org/D60934



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to