From: Fariborz Jahanian Date: Wed, 21 Jul 2010 18:40:47 +0000 (+0000) Subject: Added extra check when looking for location of '=' in X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a2eb5685aaef78ce33e84dd8c70ad3ff31b0e11;p=clang 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 --- 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.