Fix the buildbots (fallout from r227028) by returning the exprloc of non-binary opera...
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 25 Jan 2015 07:44:05 +0000 (07:44 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 25 Jan 2015 07:44:05 +0000 (07:44 +0000)
I'll give this some further thought/discussion later, but this is enough
to unbreak the buildbots at least.

llvm-svn: 227034

clang/include/clang/AST/ExprCXX.h

index db00445..fca5e32 100644 (file)
@@ -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(); }