Fixed end location of NonTypeTemplateParamDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126994 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclTemplate.cpp b/lib/AST/DeclTemplate.cpp
index a73deea..67eb11d 100644
--- a/lib/AST/DeclTemplate.cpp
+++ b/lib/AST/DeclTemplate.cpp
@@ -455,7 +455,10 @@
}
SourceRange NonTypeTemplateParmDecl::getSourceRange() const {
- return SourceRange(getOuterLocStart(), getLocation());
+ SourceLocation End = getLocation();
+ if (hasDefaultArgument() && !defaultArgumentWasInherited())
+ End = getDefaultArgument()->getSourceRange().getEnd();
+ return SourceRange(getOuterLocStart(), End);
}
SourceLocation NonTypeTemplateParmDecl::getDefaultArgumentLoc() const {