diff --git a/clang-tools-extra/clangd/FindTarget.cpp b/clang-tools-extra/clangd/FindTarget.cpp --- a/clang-tools-extra/clangd/FindTarget.cpp +++ b/clang-tools-extra/clangd/FindTarget.cpp @@ -334,6 +334,12 @@ void VisitObjCProtocolExpr(const ObjCProtocolExpr *OPE) { Outer.add(OPE->getProtocol(), Flags); } + void VisitOpaqueValueExpr(const OpaqueValueExpr *OVE) { + Outer.add(OVE->getSourceExpr(), Flags); + } + void VisitPseudoObjectExpr(const PseudoObjectExpr *POE) { + Outer.add(POE->getSyntacticForm(), Flags); + } }; Visitor(*this, Flags).Visit(S); } diff --git a/clang-tools-extra/clangd/unittests/FindTargetTests.cpp b/clang-tools-extra/clangd/unittests/FindTargetTests.cpp --- a/clang-tools-extra/clangd/unittests/FindTargetTests.cpp +++ b/clang-tools-extra/clangd/unittests/FindTargetTests.cpp @@ -503,15 +503,16 @@ EXPECT_DECLS("ObjCPropertyRefExpr", "- (void)setX:(int)x"); Code = R"cpp( - @interface Foo {} - @property int x; + @interface I {} + @property(retain) I* x; + @property(retain) I* y; @end - void test(Foo *f) { - [[f.x]] = 42; + void test(I *f) { + [[f.x]].y = 0; } )cpp"; - EXPECT_DECLS("ObjCPropertyRefExpr", - "@property(atomic, assign, unsafe_unretained, readwrite) int x"); + EXPECT_DECLS("OpaqueValueExpr", + "@property(atomic, retain, readwrite) I *x"); Code = R"cpp( @protocol Foo