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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153993
91177308-0d34-0410-b5e6-
96231b3b80d8
else if (NumInits == 0) {
Result.setStandard();
Result.Standard.setAsIdentityConversion();
+ Result.Standard.setFromType(ToType);
+ Result.Standard.setAllToTypes(ToType);
}
Result.setListInitializationSequence();
return Result;
--- /dev/null
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+
+// rdar://problem/11120365
+namespace test0 {
+ template <class T> struct A {
+ static void foo(const T &t) {}
+ static void foo(T &&t) {
+ t.foo(); // expected-error {{member reference base type 'int' is not a structure or union}}
+ }
+ };
+
+ void test() {
+ A<int>::foo({}); // expected-note {{requested here}}
+ }
+}