summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-04-04 02:40:27 +0000
committerJohn McCall <rjmccall@apple.com>2012-04-04 02:40:27 +0000
commitb73bc9af60367d5a0b11764082e561fade422194 (patch)
tree14bfbabfb70fa655a7858457e24c96d1ec465537 /clang/lib/Sema
parenta995a47e38fae9fa60164c6692d8f5c4922fc175 (diff)
downloadbcm5719-llvm-b73bc9af60367d5a0b11764082e561fade422194.tar.gz
bcm5719-llvm-b73bc9af60367d5a0b11764082e561fade422194.zip
When computing the conversion sequence in overload resolution
for converting an empty list to a scalar, be sure to initialize the source and destination types so that comparison of conversion sequences will work in case there are multiple viable candidates. llvm-svn: 153993
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaOverload.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 27b04a74272..7afa39f3f3b 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -4433,6 +4433,8 @@ TryListConversion(Sema &S, InitListExpr *From, QualType ToType,
else if (NumInits == 0) {
Result.setStandard();
Result.Standard.setAsIdentityConversion();
+ Result.Standard.setFromType(ToType);
+ Result.Standard.setAllToTypes(ToType);
}
Result.setListInitializationSequence();
return Result;
OpenPOWER on IntegriCloud