From: Steve Naroff Date: Fri, 23 May 2008 22:00:37 +0000 (+0000) Subject: Fix range info for explicit ivar refs. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8bf3b1d0e75da8b15bc331ebeb44f34b689f03ad;p=clang Fix range info for explicit ivar refs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51507 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index 9760b3652f..0b16732ef6 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -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; }