Reviewers: sammccall
Reviewed By: sammccall
Subscribers: merge_guards_bot, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70773
RelSet Flags;
Visitor(TargetFinder &Outer, RelSet Flags) : Outer(Outer), Flags(Flags) {}
+ void VisitCallExpr(const CallExpr *CE) {
+ Outer.add(CE->getCalleeDecl(), Flags);
+ }
void VisitDeclRefExpr(const DeclRefExpr *DRE) {
const Decl *D = DRE->getDecl();
// UsingShadowDecl allows us to record the UsingDecl.
auto X = S() [[+]] S();
)cpp";
EXPECT_DECLS("DeclRefExpr", "S operator+(S) const");
+
+ Code = R"cpp(
+ int foo();
+ int s = foo[[()]];
+ )cpp";
+ EXPECT_DECLS("CallExpr", "int foo()");
+
+ Code = R"cpp(
+ struct X {
+ void operator()(int n);
+ };
+ void test() {
+ X x;
+ x[[(123)]];
+ }
+ )cpp";
+ EXPECT_DECLS("CXXOperatorCallExpr", "void operator()(int n)");
}
TEST_F(TargetDeclTest, UsingDecl) {