aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprCXX.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-04-02 09:47:38 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-04-02 09:47:38 +0000
commitd7650610b39947ad8ea8273e7e5099894f71bb08 (patch)
tree6ecda02461828d41fa98542a198daed5fc233c9b /lib/AST/ExprCXX.cpp
parent2bfa3019b8fb35931ca4927feaf25d39161b423e (diff)
Apply a bug-fix patch from Marcin Kowalczyk to the source locations for
a couple of operator overloads which form interesting expressions in the AST. I added test cases for both bugs with the c-index-test's token annotation feature. Also, thanks to John McCall for confirming that this is the correct solution. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128768 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprCXX.cpp')
-rw-r--r--lib/AST/ExprCXX.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp
index 02d60ef0a7..526c484677 100644
--- a/lib/AST/ExprCXX.cpp
+++ b/lib/AST/ExprCXX.cpp
@@ -368,8 +368,10 @@ SourceRange CXXOperatorCallExpr::getSourceRange() const {
getArg(0)->getSourceRange().getEnd());
else
// Postfix operator
- return SourceRange(getArg(0)->getSourceRange().getEnd(),
+ return SourceRange(getArg(0)->getSourceRange().getBegin(),
getOperatorLoc());
+ } else if (Kind == OO_Arrow) {
+ return getArg(0)->getSourceRange();
} else if (Kind == OO_Call) {
return SourceRange(getArg(0)->getSourceRange().getBegin(), getRParenLoc());
} else if (Kind == OO_Subscript) {