summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/refactor/Rename.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clangd/refactor/Rename.cpp')
-rw-r--r--clang-tools-extra/clangd/refactor/Rename.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang-tools-extra/clangd/refactor/Rename.cpp b/clang-tools-extra/clangd/refactor/Rename.cpp
index 306c804bb59..770064fc613 100644
--- a/clang-tools-extra/clangd/refactor/Rename.cpp
+++ b/clang-tools-extra/clangd/refactor/Rename.cpp
@@ -153,8 +153,9 @@ findOccurrencesWithinFile(ParsedAST &AST, const NamedDecl *RenameDecl) {
llvm::Expected<tooling::Replacements>
renameWithinFile(ParsedAST &AST, llvm::StringRef File, Position Pos,
llvm::StringRef NewName, const SymbolIndex *Index) {
- SourceLocation SourceLocationBeg = getBeginningOfIdentifier(
- Pos, AST.getSourceManager(), AST.getASTContext().getLangOpts());
+ const SourceManager &SM = AST.getSourceManager();
+ SourceLocation SourceLocationBeg = SM.getMacroArgExpandedLocation(
+ getBeginningOfIdentifier(Pos, SM, AST.getASTContext().getLangOpts()));
// FIXME: renaming macros is not supported yet, the macro-handling code should
// be moved to rename tooling library.
if (locateMacroAt(SourceLocationBeg, AST.getPreprocessor()))
OpenPOWER on IntegriCloud