Index: clangd/XRefs.cpp =================================================================== --- clangd/XRefs.cpp +++ clangd/XRefs.cpp @@ -219,9 +219,8 @@ } for (auto Item : MacroInfos) { - SourceRange SR(Item.Info->getDefinitionLoc(), - Item.Info->getDefinitionEndLoc()); - auto L = makeLocation(AST, SR); + auto Loc = Item.Info->getDefinitionLoc(); + auto L = makeLocation(AST, SourceRange(Loc, Loc)); if (L) Result.push_back(*L); } Index: unittests/clangd/XRefsTests.cpp =================================================================== --- unittests/clangd/XRefsTests.cpp +++ unittests/clangd/XRefsTests.cpp @@ -207,7 +207,7 @@ R"cpp(// Macro #define MACRO 0 - #define [[MACRO 1]] + #define [[MACRO]] 1 int main() { return ^MACRO; } #define MACRO 2 #undef macro @@ -215,7 +215,7 @@ R"cpp(// Macro class TTT { public: int a; }; - #define [[FF(S) if (int b = S.a) {}]] + #define [[FF]](S) if (int b = S.a) {} void f() { TTT t; F^F(t);