From 2b5940d1da4ce61022aa931c84b77b919b05340e Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sun, 25 Jan 2015 07:44:05 +0000 Subject: [PATCH] Fix the buildbots (fallout from r227028) by returning the exprloc of non-binary operator overload calls (and ->) to the start of the expression, not the location of the operator I'll give this some further thought/discussion later, but this is enough to unbreak the buildbots at least. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227034 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/ExprCXX.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h index db00445f68..fca5e32472 100644 --- a/include/clang/AST/ExprCXX.h +++ b/include/clang/AST/ExprCXX.h @@ -86,7 +86,12 @@ public: /// of the right bracket. SourceLocation getOperatorLoc() const { return getRParenLoc(); } - SourceLocation getExprLoc() const LLVM_READONLY { return getOperatorLoc(); } + SourceLocation getExprLoc() const LLVM_READONLY { + return (Operator < OO_Plus || Operator >= OO_Arrow || + Operator == OO_PlusPlus || Operator == OO_MinusMinus) + ? getLocStart() + : getOperatorLoc(); + } SourceLocation getLocStart() const LLVM_READONLY { return Range.getBegin(); } SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); } -- 2.40.0