diff options
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 7afa39f3f3b..e4c6fdfb59c 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -4301,6 +4301,16 @@ TryListConversion(Sema &S, InitListExpr *From, QualType ToType, ImplicitConversionSequence::Worse) Result = ICS; } + + // For an empty list, we won't have computed any conversion sequence. + // Introduce the identity conversion sequence. + if (From->getNumInits() == 0) { + Result.setStandard(); + Result.Standard.setAsIdentityConversion(); + Result.Standard.setFromType(ToType); + Result.Standard.setAllToTypes(ToType); + } + Result.setListInitializationSequence(); Result.setStdInitializerListElement(toStdInitializerList); return Result; |

