[PATCH] D49223: [AST] Check described template at structural equivalence check.

Aleksei Sidorin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 3 15:17:23 PDT 2018

a_sidorin added inline comments.

Comment at: lib/AST/ASTStructuralEquivalence.cpp:958
+  if (D1->isTemplated() != D2->isTemplated())
+    return false;
balazske wrote:
> a_sidorin wrote:
> > I think we can move the changes for both RecordDecl and FunctionDecl into `Finish()` and use `Decl::getDescribedTemplate()`. This will both simplify the patch and give us the support for templated VarDecls and TypeAliasDecls for free. What do you think?
> Yes it can be good to check with `getDescribedClassTemplate` in `Finish`. (Similarly, there can be more things that are common to check with all `Decl` or `NamedDecl` objects in `Finish`, specifically the name is checked. Or in some cases the name does not matter, but in others yes?)
I think that name always matters for structure equivalence checking. I cannot remember any case where it was false during development of our PoC.

  rC Clang


More information about the cfe-commits mailing list