]> granicus.if.org Git - clang/commitdiff
Fix range info for explicit ivar refs.
authorSteve Naroff <snaroff@apple.com>
Fri, 23 May 2008 22:00:37 +0000 (22:00 +0000)
committerSteve Naroff <snaroff@apple.com>
Fri, 23 May 2008 22:00:37 +0000 (22:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51507 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Expr.h

index 9760b3652f4fef48df6afa31d20fb107377c3f27..0b16732ef643696d4fdeedb9dda1865937cd7fb9 100644 (file)
@@ -1533,7 +1533,10 @@ public:
   
   ObjCIvarDecl *getDecl() { return D; }
   const ObjCIvarDecl *getDecl() const { return D; }
-  virtual SourceRange getSourceRange() const { return SourceRange(Loc); }
+  virtual SourceRange getSourceRange() const { 
+    return isFreeIvar() ? SourceRange(Loc)
+                        : SourceRange(getBase()->getLocStart(), Loc); 
+  }
   const Expr *getBase() const { return Base; }
   Expr *getBase() { return Base; }
   void setBase(Expr * base) { Base = base; }