]> granicus.if.org Git - clang/commitdiff
Added extra check when looking for location of '=' in
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 21 Jul 2010 18:40:47 +0000 (18:40 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 21 Jul 2010 18:40:47 +0000 (18:40 +0000)
a copy initialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109025 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaInit.cpp

index 0361f25913fb075678de9f3f4e8ac276b16197c9..7a5c1459d6d0203bd7f109a5b2ee8f97f08a1751 100644 (file)
@@ -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.