diff options
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index dc576815735..3408ff7087f 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -1086,18 +1086,21 @@ Sema::PerformImplicitConversion(Expr *&From, QualType ToType, } else if (const CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(FD)) { CastKind = CastExpr::CK_ConstructorConversion; - - // If the user-defined conversion is specified by a constructor, the - // initial standard conversion sequence converts the source type to the - // type required by the argument of the constructor - BeforeToType = Ctor->getParamDecl(0)->getType(); + // Do no conversion if dealing with ... for the first conversion. + if (!ICS.UserDefined.EllipsisConversion) + // If the user-defined conversion is specified by a constructor, the + // initial standard conversion sequence converts the source type to the + // type required by the argument of the constructor + BeforeToType = Ctor->getParamDecl(0)->getType(); } else assert(0 && "Unknown conversion function kind!"); - - if (PerformImplicitConversion(From, BeforeToType, - ICS.UserDefined.Before, "converting")) - return true; + // Whatch out for elipsis conversion. + if (!BeforeToType.isNull()) { + if (PerformImplicitConversion(From, BeforeToType, + ICS.UserDefined.Before, "converting")) + return true; + } OwningExprResult CastArg = BuildCXXCastArgument(From->getLocStart(), |