Page MenuHomePhabricator

[SyntaxTree] Ignore implicit non-leaf `CXXConstructExpr`
ClosedPublic

Authored by eduucaldas on Thu, Aug 27, 4:44 AM.

Diff Detail

Event Timeline

eduucaldas created this revision.Thu, Aug 27, 4:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptThu, Aug 27, 4:44 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
eduucaldas requested review of this revision.Thu, Aug 27, 4:44 AM

Use IgnoreExpr.h infrastructure.

eduucaldas added inline comments.
clang/lib/Tooling/Syntax/BuildTree.cpp
48–58

Should this go into IgnoreExpr as well?

If yes, should we unify this with the lambda inside IgnoreUnlessSpelledInSource, thus removing the lambda and using this free function instead?

gribozavr2 accepted this revision.Mon, Aug 31, 12:31 PM
gribozavr2 added inline comments.
clang/lib/Tooling/Syntax/BuildTree.cpp
48–58

That sounds like a good idea to me.

clang/unittests/Tooling/Syntax/BuildTreeTest.cpp
1749

Could you also add a test that invokes implicit conversions?

struct X {
  X(int);
};
void TakeX(const X&);

void test() {
  [[TakeX(1)]];
}
This revision is now accepted and ready to land.Mon, Aug 31, 12:31 PM
eduucaldas updated this revision to Diff 289103.Tue, Sep 1, 1:59 AM
eduucaldas marked 2 inline comments as done.

Add further tests and extract IgnoreImplicitConstructorSingleStep

gribozavr2 accepted this revision.Tue, Sep 1, 2:18 AM
eduucaldas updated this revision to Diff 290223.Mon, Sep 7, 2:36 AM

Add more tests, not extract IgnoreImplicitConstructorSingleStep

eduucaldas updated this revision to Diff 290259.Mon, Sep 7, 5:39 AM

Add comments

eduucaldas added inline comments.Mon, Sep 7, 5:45 AM
clang/lib/Tooling/Syntax/BuildTree.cpp
48–50

Please give feedback on this comments and should I comment the rest of the function?

gribozavr2 accepted this revision.Mon, Sep 7, 10:30 AM
gribozavr2 added inline comments.
clang/lib/Tooling/Syntax/BuildTree.cpp
48
48–50

Seems straightforward to me.

clang/unittests/Tooling/Syntax/BuildTreeTest.cpp
4045

This is not a conversion, this is an explicit constructor call (CXXTemporaryObjectExpr) -- so please rename the test. Same for other tests below.

eduucaldas marked 3 inline comments as done.

answer comments

clang/unittests/Tooling/Syntax/BuildTreeTest.cpp
4045

I am trying to follow the syntax to name things. And in the grammar this is under "Explicit type conversion (functional notation)", which englobes as well things of the type float(3).

  • Rename tests
  • Add FIXMEs for init-declarators
gribozavr2 accepted this revision.Tue, Sep 8, 1:38 AM