When checking a class or function the described class or function template
is checked too.
Improved test with symmetric check, added new tests.
Details
Diff Detail
- Repository
- rC Clang
- Build Status
Buildable 21115 Build 21115: arc lint + arc unit
Event Timeline
lib/AST/ASTStructuralEquivalence.cpp | ||
---|---|---|
1025 | 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? |
lib/AST/ASTStructuralEquivalence.cpp | ||
---|---|---|
1025 | 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?) |
lib/AST/ASTStructuralEquivalence.cpp | ||
---|---|---|
1025 | I think that name always matters for structure equivalence checking. I cannot remember any case where it was false during development of our PoC. |
Hi Balazs,
I have only two nits. Otherwise, the patch is OK and can be committed without additional approval after the comments are fixed. Thank you!
lib/AST/ASTStructuralEquivalence.cpp | ||
---|---|---|
1500 | CheckCommonEquivalence/CheckKindSpecificEquivalence? | |
1643 | Equivalent = CommonCheckAtFinish(D1, D2) && SpecialCheckAtFinish(D1, D2))? |
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?