diff options
-rw-r--r-- | include/clang/AST/Expr.h | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |