Add support for all C++ call expressions, including those coming from operator().
A call expression's arguments are inside their own node - CallArguments - based on the List base API.
Details
- Reviewers
gribozavr2 - Commits
- rG2de2ca348dfa: [SyntaxTree] Add support for `CallExpression`
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/unittests/Tooling/Syntax/BuildTreeTest.cpp | ||
---|---|---|
506 | This is wrong but it's just because decltype is all wrong | |
2734 | Here there is a divergence between the grammar and the ClangAST. Perhaps I have used the wrong kind of ... |
clang/include/clang/Tooling/Syntax/Nodes.h | ||
---|---|---|
333 | ||
clang/lib/Tooling/Syntax/BuildTree.cpp | ||
1070 | Could you add an assertion that it is indeed an open paren? Or, rather, due to the decltype test, it has to be a check, and a FIXME that says that the check should become an assertion. | |
1160 | I don't understand this change to the unknown case, could you explain? | |
clang/unittests/Tooling/Syntax/BuildTreeTest.cpp | ||
2320 | ||
2343 | ||
2431–2436 | ||
2437 | Please also add a test for pf() -- that's allowed, but I believe the AST is slightly different from f(). | |
2734 |
I don't think so. Note that every element of initializer-list can have a ... in it. |
Answer code review, squash commits
clang/lib/Tooling/Syntax/BuildTree.cpp | ||
---|---|---|
1070 | Thanks! It is indeed what I should've done :) | |
1160 | CXXOperatorCallExpr <- CallExpr <- Expr In this change we added an overload for WalkUpFromCallExpr, so we started intercepting the WalkUp at CallExpr instead of Expr, this works around that. | |
clang/unittests/Tooling/Syntax/BuildTreeTest.cpp | ||
2734 | True! I hadn't seen it correctly! |