diff options
-rw-r--r-- | clang/include/clang/AST/ExprCXX.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/include/clang/AST/ExprCXX.h b/clang/include/clang/AST/ExprCXX.h index db00445f689..fca5e32472d 100644 --- a/clang/include/clang/AST/ExprCXX.h +++ b/clang/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(); } |