aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-07-21 18:31:47 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-07-21 18:31:47 +0000
commit10f8e319569c8b8b4603d8a72ce01a7a01502c85 (patch)
tree8eafdfcbc082d3e5e2def91b6f335529652c2c43 /lib/Sema/SemaInit.cpp
parentad4f387b451372c3e9b533995aa216678b78c53d (diff)
Fix source location of the initializer in
a copy initialization. Back out hack in objc rewriter. fixes radar 8213998. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109024 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r--lib/Sema/SemaInit.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 648780f306..0361f25913 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -3803,7 +3803,8 @@ InitializationSequence::Perform(Sema &S,
// Build a call to the selected constructor.
ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(S);
- SourceLocation Loc = Kind.getLocation();
+ SourceLocation Loc = Kind.isCopyInit() ? Kind.getEqualLoc()
+ : Kind.getLocation();
// Determine the arguments required to actually perform the constructor
// call.
@@ -3819,11 +3820,11 @@ InitializationSequence::Perform(Sema &S,
// An explicitly-constructed temporary, e.g., X(1, 2).
unsigned NumExprs = ConstructorArgs.size();
Expr **Exprs = (Expr **)ConstructorArgs.take();
- S.MarkDeclarationReferenced(Kind.getLocation(), Constructor);
+ S.MarkDeclarationReferenced(Loc, Constructor);
CurInit = S.Owned(new (S.Context) CXXTemporaryObjectExpr(S.Context,
Constructor,
Entity.getType(),
- Kind.getLocation(),
+ Loc,
Exprs,
NumExprs,
Kind.getParenRange().getEnd(),