[PATCH] D126757: Fix clang RecursiveASTVisitor for definition of XXXTemplateSpecializationDecl

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 1 00:13:47 PDT 2022


nridge added a comment.

Thanks for the patch!

Could you add a semantic highlighting test case to SemanticHighlighting.GetsCorrectTokens <https://searchfox.org/llvm/rev/c7bee26f4fe170a065e48a2650e70802e9fc9ece/clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp#97> as well please? The test cases there are pieces of code annotated with the type of highlighting kind each token should get.



================
Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:2037
                                                                                \
     TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));              \
+    if (getDerived().shouldVisitTemplateInstantiations() ||                    \
----------------
We should move this call to `TraverseNestedNameSpecifierLoc` into the `else` branch, since `Traverse...Helper` already does that:

* `TraverseCXXRecordHelper` does it via `TraverseRecordHelper` [here](https://searchfox.org/llvm/rev/c7bee26f4fe170a065e48a2650e70802e9fc9ece/clang/include/clang/AST/RecursiveASTVisitor.h#1995)
* `TraverseVarHelper` does it via `TraverseDeclaratorHelper` [here](https://searchfox.org/llvm/rev/c7bee26f4fe170a065e48a2650e70802e9fc9ece/clang/include/clang/AST/RecursiveASTVisitor.h#2098)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126757



More information about the cfe-commits mailing list