diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-20 02:31:03 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-20 02:31:03 +0000 |
commit | e44201a2841a38cc4165f630afd1709e7d9cd752 (patch) | |
tree | 454c65a6e48617999c10869163a9c5805862fdff /lib/Sema/SemaExprCXX.cpp | |
parent | e36c9abd383267775a5079166e5e02119866c129 (diff) |
Don't build an explicit conversion to a reference type
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89441 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 6f0cb8a270..5962466023 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -1156,11 +1156,12 @@ Sema::PerformImplicitConversion(Expr *&From, QualType ToType, dyn_cast<CXXConstructorDecl>(FD)) { CastKind = CastExpr::CK_ConstructorConversion; // Do no conversion if dealing with ... for the first conversion. - if (!ICS.UserDefined.EllipsisConversion) + 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(); + BeforeToType = Ctor->getParamDecl(0)->getType().getNonReferenceType(); + } } else assert(0 && "Unknown conversion function kind!"); |