[PATCH] D129973: [clang] Pass FoundDecl to DeclRefExpr creator for operator overloads

Danny Mösch via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 21 12:05:51 PDT 2022


SimplyDanny marked an inline comment as done.
SimplyDanny added inline comments.


================
Comment at: clang/test/Index/annotate-operator-call-expr.cpp:21
+// CHECK1: Punctuation: "(" [7:6 - 7:7] CallExpr=operator():3:7
+// CHECK1: Punctuation: ")" [7:7 - 7:8] CallExpr=operator():3:7
 // CHECK1: Punctuation: ";" [7:8 - 7:9] CompoundStmt=
----------------
I updated the test expectation without actually knowing whether the test references are correct(er) now. There seems to be some loss of information and some `CallExpr`s are now seen as `DeclRefExpr`s. Please tell me if these changes are okay. I rather made them to have a basis for discussions.


================
Comment at: clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp:4679
+  EXPECT_TRUE(matches(
+    "struct S {}; namespace a { int operator+(S s1, S s2) { return 0; }; } using a::operator+; int g() { S a, b; return a + b; }",
+    declRefExpr(throughUsingDecl(anything()))));
----------------
shafik wrote:
> You have a trailing `;` after the definition of `a::operator+` please remove it.
Made it a declaration which is sufficient for the test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129973



More information about the cfe-commits mailing list