summaryrefslogtreecommitdiffstats
path: root/tools/libclang/CIndexUSRs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/libclang/CIndexUSRs.cpp')
-rw-r--r--tools/libclang/CIndexUSRs.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/libclang/CIndexUSRs.cpp b/tools/libclang/CIndexUSRs.cpp
index 9917d2a..4f1f071 100644
--- a/tools/libclang/CIndexUSRs.cpp
+++ b/tools/libclang/CIndexUSRs.cpp
@@ -477,6 +477,9 @@ bool USRGenerator::GenLoc(const Decl *D) {
return true;
}
+ // Use the location of canonical decl.
+ D = D->getCanonicalDecl();
+
const SourceManager &SM = AU->getSourceManager();
SourceLocation L = D->getLocStart();
if (L.isInvalid()) {
OpenPOWER on IntegriCloud