diff options
| author | Anders Carlsson <andersca@mac.com> | 2009-08-27 17:24:15 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2009-08-27 17:24:15 +0000 |
| commit | ef4c72135f8ec1ba93beeb0e7d4a6dbcc8ce1fb5 (patch) | |
| tree | dfcb89ed6a83e80d4db69c4709084ce958f9eb74 /clang/lib/Sema/SemaExprCXX.cpp | |
| parent | f871945c3965d89df3447cf4dd35eee366142b31 (diff) | |
| download | bcm5719-llvm-ef4c72135f8ec1ba93beeb0e7d4a6dbcc8ce1fb5.tar.gz bcm5719-llvm-ef4c72135f8ec1ba93beeb0e7d4a6dbcc8ce1fb5.zip | |
Remove default arguments from TryImplicitConversion and fix a bug found in the process.
llvm-svn: 80258
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 870041dc87e..98b3d29e531 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -884,11 +884,16 @@ Sema::PerformImplicitConversion(Expr *&From, QualType ToType, ImplicitConversionSequence ICS; ICS.ConversionKind = ImplicitConversionSequence::BadConversion; if (Elidable && getLangOptions().CPlusPlus0x) { - ICS = TryImplicitConversion(From, ToType, /*SuppressUserConversions*/false, - AllowExplicit, /*ForceRValue*/true); + ICS = TryImplicitConversion(From, ToType, + /*SuppressUserConversions=*/false, + AllowExplicit, + /*ForceRValue=*/true); } if (ICS.ConversionKind == ImplicitConversionSequence::BadConversion) { - ICS = TryImplicitConversion(From, ToType, false, AllowExplicit); + ICS = TryImplicitConversion(From, ToType, + /*SuppressUserConversions=*/false, + AllowExplicit, + /*ForceRValue=*/false); } return PerformImplicitConversion(From, ToType, ICS, Flavor); } @@ -1244,7 +1249,10 @@ static bool TryClassUnification(Sema &Self, Expr *From, Expr *To, // Now try the implicit conversion. // FIXME: This doesn't detect ambiguities. - ICS = Self.TryImplicitConversion(From, TTy); + ICS = Self.TryImplicitConversion(From, TTy, + /*SuppressUserConversions=*/false, + /*AllowExplicit=*/false, + /*ForceRValue=*/false); } return false; } @@ -1627,15 +1635,30 @@ QualType Sema::FindCompositePointerType(Expr *&E1, Expr *&E2) { } } - ImplicitConversionSequence E1ToC1 = TryImplicitConversion(E1, Composite1); - ImplicitConversionSequence E2ToC1 = TryImplicitConversion(E2, Composite1); + ImplicitConversionSequence E1ToC1 = + TryImplicitConversion(E1, Composite1, + /*SuppressUserConversions=*/false, + /*AllowExplicit=*/false, + /*ForceRValue=*/false); + ImplicitConversionSequence E2ToC1 = + TryImplicitConversion(E2, Composite1, + /*SuppressUserConversions=*/false, + /*AllowExplicit=*/false, + /*ForceRValue=*/false); + ImplicitConversionSequence E1ToC2, E2ToC2; E1ToC2.ConversionKind = ImplicitConversionSequence::BadConversion; E2ToC2.ConversionKind = ImplicitConversionSequence::BadConversion; if (Context.getCanonicalType(Composite1) != Context.getCanonicalType(Composite2)) { - E1ToC2 = TryImplicitConversion(E1, Composite2); - E2ToC2 = TryImplicitConversion(E2, Composite2); + E1ToC2 = TryImplicitConversion(E1, Composite2, + /*SuppressUserConversions=*/false, + /*AllowExplicit=*/false, + /*ForceRValue=*/false); + E2ToC2 = TryImplicitConversion(E2, Composite2, + /*SuppressUserConversions=*/false, + /*AllowExplicit=*/false, + /*ForceRValue=*/false); } bool ToC1Viable = E1ToC1.ConversionKind != |

