[PATCH] D85439: [SyntaxTree] Expand support for `NestedNameSpecifier`
Eduardo Caldas via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 10 02:41:03 PDT 2020
eduucaldas marked 2 inline comments as done.
eduucaldas added a comment.
Now NNS are based on inheritance!
================
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:849-850
+ const auto TL = NNSLoc.getTypeLoc().castAs<DecltypeTypeLoc>();
+ if (!RecursiveASTVisitor::TraverseDecltypeTypeLoc(TL))
+ return nullptr;
+ auto *NS = new (allocator()) syntax::DecltypeNameSpecifier;
----------------
Since we are overriding the TraverseNestedNameSpecifierLoc that previously fired TraverseTypeLoc we fire it when building a NameSpecifier.
================
Comment at: clang/unittests/Tooling/Syntax/TreeTest.cpp:1235
| | | | | |-(
- | | | | | |-IdExpression
- | | | | | | `-UnqualifiedId
- | | | | | | `-s
+ | | | | | |-s
| | | | | `-)
----------------
eduucaldas wrote:
> standard `TraverseNestedNameSpecifierLoc` fired `TraverseTypeLoc`, once we override it we lost this. This will be fixed when refining the Node for `DecltypeSpecifier`
This is no longer an issue, because we now fire TraverseTypeLoc in the case of DecltypeNameSpecifier
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85439/new/
https://reviews.llvm.org/D85439
More information about the cfe-commits
mailing list