]> granicus.if.org Git - clang/commitdiff
use a slightly more sensible position for an array ref's "getExprLoc"
authorChris Lattner <sabre@nondot.org>
Tue, 13 Jan 2009 21:11:15 +0000 (21:11 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 13 Jan 2009 21:11:15 +0000 (21:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62182 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Expr.h

index d1aac8100d9654a7354fea4672e2ddcca37f9364..2f2d4a6e39ab78c4342dcdcf4cfccc989db8b140 100644 (file)
@@ -728,7 +728,7 @@ public:
     return SourceRange(getLHS()->getLocStart(), RBracketLoc);
   }
   
-  virtual SourceLocation getExprLoc() const { return RBracketLoc; }
+  virtual SourceLocation getExprLoc() const { return getBase()->getExprLoc(); }
 
   static bool classof(const Stmt *T) { 
     return T->getStmtClass() == ArraySubscriptExprClass;