aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-07-15 16:25:15 +0000
committerDouglas Gregor <dgregor@apple.com>2011-07-15 16:25:15 +0000
commit5b8968cc599eb6100bb73ae87be9d6cd2577ac9e (patch)
tree4e805bd7bf2f71e0a64dbe4ce279c4b910276812 /lib/Sema/SemaOverload.cpp
parent91ae6b43b3a294243698cdb544dd7a18efa4c7a8 (diff)
Store bracket locations for array subscript expressions, from Erik Verbruggen!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135275 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index b95b886efb..437b2b5c6d 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -38,8 +38,10 @@ using namespace sema;
/// function.
static ExprResult
CreateFunctionRefExpr(Sema &S, FunctionDecl *Fn,
- SourceLocation Loc = SourceLocation()) {
- ExprResult E = S.Owned(new (S.Context) DeclRefExpr(Fn, Fn->getType(), VK_LValue, Loc));
+ SourceLocation Loc = SourceLocation(),
+ const DeclarationNameLoc &LocInfo = DeclarationNameLoc()){
+ ExprResult E = S.Owned(new (S.Context) DeclRefExpr(Fn, Fn->getType(),
+ VK_LValue, Loc, LocInfo));
E = S.DefaultFunctionArrayConversion(E.take());
if (E.isInvalid())
return ExprError();
@@ -8878,7 +8880,10 @@ Sema::CreateOverloadedArraySubscriptExpr(SourceLocation LLoc,
ResultTy = ResultTy.getNonLValueExprType(Context);
// Build the actual expression node.
- ExprResult FnExpr = CreateFunctionRefExpr(*this, FnDecl, LLoc);
+ DeclarationNameLoc LocInfo;
+ LocInfo.CXXOperatorName.BeginOpNameLoc = LLoc.getRawEncoding();
+ LocInfo.CXXOperatorName.EndOpNameLoc = RLoc.getRawEncoding();
+ ExprResult FnExpr = CreateFunctionRefExpr(*this, FnDecl, LLoc, LocInfo);
if (FnExpr.isInvalid())
return ExprError();