diff options
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 85924948da..1d05008cbe 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -881,14 +881,19 @@ Sema::PerformImplicitConversion(Expr *&From, QualType ToType, const char *Flavor, bool AllowExplicit, bool Elidable) { + unsigned Flags = ORF_None; + if (AllowExplicit) + Flags |= ORF_AllowExplicit; + ImplicitConversionSequence ICS; ICS.ConversionKind = ImplicitConversionSequence::BadConversion; if (Elidable && getLangOptions().CPlusPlus0x) { - ICS = TryImplicitConversion(From, ToType, /*SuppressUserConversions*/false, - AllowExplicit, /*ForceRValue*/true); + Flags |= ORF_ForceRValue; + + ICS = TryImplicitConversion(From, ToType, Flags); } if (ICS.ConversionKind == ImplicitConversionSequence::BadConversion) { - ICS = TryImplicitConversion(From, ToType, false, AllowExplicit); + ICS = TryImplicitConversion(From, ToType, Flags); } return PerformImplicitConversion(From, ToType, ICS, Flavor); } |