From 0a2eb5685aaef78ce33e84dd8c70ad3ff31b0e11 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Wed, 21 Jul 2010 18:40:47 +0000 Subject: [PATCH] Added extra check when looking for location of '=' in a copy initialization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109025 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaInit.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 0361f25913..7a5c1459d6 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -3803,8 +3803,9 @@ InitializationSequence::Perform(Sema &S, // Build a call to the selected constructor. ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(S); - SourceLocation Loc = Kind.isCopyInit() ? Kind.getEqualLoc() - : Kind.getLocation(); + SourceLocation Loc = (Kind.isCopyInit() && Kind.getEqualLoc().isValid()) + ? Kind.getEqualLoc() + : Kind.getLocation(); // Determine the arguments required to actually perform the constructor // call. -- 2.40.0