diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index a8b0bd27b98..54b05478108 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -509,6 +509,11 @@ void UserDefinedConversionSequence::DebugPrint() const { /// error. Useful for debugging overloading issues. void ImplicitConversionSequence::DebugPrint() const { raw_ostream &OS = llvm::errs(); + if (isListInitializationSequence()) { + OS << "List-initialization sequence: "; + if (isStdInitializerListElement()) + OS << "Worst std::initializer_list element conversion: "; + } switch (ConversionKind) { case StandardConversion: OS << "Standard conversion: "; @@ -4524,11 +4529,13 @@ TryListConversion(Sema &S, InitListExpr *From, QualType ToType, = S.CompareReferenceRelationship(From->getLocStart(), T1, T2, dummy1, dummy2, dummy3); - if (RefRelationship >= Sema::Ref_Related) - return TryReferenceInit(S, Init, ToType, - /*FIXME:*/From->getLocStart(), - SuppressUserConversions, - /*AllowExplicit=*/false); + if (RefRelationship >= Sema::Ref_Related) { + Result = TryReferenceInit(S, Init, ToType, /*FIXME*/From->getLocStart(), + SuppressUserConversions, + /*AllowExplicit=*/false); + Result.setListInitializationSequence(); + return Result; + } } // Otherwise, we bind the reference to a temporary created from the |