1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Bug 491842 - Name resolution problem with initializer list

Change-Id: I9a70beb41e9819ca9e980b16249bd080f4d21e97
This commit is contained in:
Sergey Prigogin 2016-04-19 19:13:37 -07:00
parent 3b8da01c12
commit a295702335
2 changed files with 23 additions and 2 deletions

View file

@ -8883,6 +8883,22 @@ public class AST2CPPTests extends AST2TestBase {
parseAndCheckImplicitNameBindings();
}
// namespace std { template<typename T> class initializer_list; }
//
// struct A {
// A(const char* s);
// };
//
// void waldo(A p);
// void waldo(std::initializer_list<A> p);
//
// void test() {
// waldo({""});
// }
public void testListInitialization_491842() throws Exception {
parseAndCheckBindings();
}
// namespace std {
// template<typename T> class initializer_list;
// }

View file

@ -633,6 +633,11 @@ public class Conversions {
} else {
c= Cost.NO_CONVERSION;
}
// This cost came from listInitializationSequence() with an std::initializer_list
// type as the list initialization target. From the point of view of the caller,
// however, the target is the class type, not std::initializer_list, so update it
// accordingly.
c.setListInitializationTarget(t);
return c;
}