Fix a major oversight in the comparison of standard conversion
sequences, where we would occasionally determine (incorrectly) that
one standard conversion sequence was a proper subset of another when,
in fact, they contained completely incomparable conversions.
This change records the types in each step within a standard
conversion sequence, so that we can check the specific comparison
types to determine when one sequence is a proper subset of the
other. Fixes this testcase (thanks, Anders!), which was distilled from
PR6095 (also thanks to Anders).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94660 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 3ff750e..847991d 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -1487,9 +1487,9 @@
static QualType TargetType(const ImplicitConversionSequence &ICS) {
switch (ICS.getKind()) {
case ImplicitConversionSequence::StandardConversion:
- return ICS.Standard.getToType();
+ return ICS.Standard.getToType(2);
case ImplicitConversionSequence::UserDefinedConversion:
- return ICS.UserDefined.After.getToType();
+ return ICS.UserDefined.After.getToType(2);
case ImplicitConversionSequence::AmbiguousConversion:
return ICS.Ambiguous.getToType();
case ImplicitConversionSequence::EllipsisConversion: