[patch] Fix source range of overloaded postfix operators and of overloaded operator->

Without this 'it->first' with 'it' of a class type is claimed to begin
at '->' instead of at 'it', because operator-> gets lumped with prefix
operators.

I believe the arrow should not be included in the end of the range
either, so the whole LHS of such MemberExpr is just 'it', dressed in
an overloaded operator-> call which changes the type.

I spotted a bug in postfix operators while fixing operator->, I assume
it's correct (this one is not tested).

I'm not subscribed.

--- /tmp/g4-89926/cache/depot/google3/third_party/llvm/trunk/tools/clang/lib/AST/ExprCXX.cpp#50
2011-03-16 21:11:57.000000000 +0100
+++ /home/qrczak/qrczak-janitor/google3/third_party/llvm/trunk/tools/clang/lib/AST/ExprCXX.cpp
2011-04-01 19:38:50.805324000 +0200
@@ -368,8 +368,10 @@
                          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) {

Without this 'it->first' with 'it' of a class type is claimed to begin
at '->' instead of at 'it', because operator-> gets lumped with prefix
operators.

Nice catch.

I believe the arrow should not be included in the end of the range
either, so the whole LHS of such MemberExpr is just 'it', dressed in
an overloaded operator-> call which changes the type.

I think that's a reasonable interpretation.

I spotted a bug in postfix operators while fixing operator->, I assume
it's correct (this one is not tested).

Yeah, looks good.

I take it you don't have commit privileges?

John.

Indeed I don't have.

I committed this in r128768 along with tests for both bugs. They both were easy to trigger in the c-index-test token annotation tool.