1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-09 09:15:38 +02:00

Bug 549035 - Constructor with reference to initializer list

Change-Id: I83fd8d2453c36feb51bab80b5bf0943b68a1c97a
This commit is contained in:
Nathan Ridge 2019-07-07 18:24:18 -04:00
parent 4c0e7d9f68
commit f78158904b
2 changed files with 15 additions and 0 deletions

View file

@ -12852,6 +12852,20 @@ public class AST2CPPTests extends AST2CPPTestBase {
bh.assertImplicitName("a0", 2, IProblemBinding.class);
}
// namespace std {
// template<class>
// class initializer_list {};
// }
//
// struct A {
// A(const std::initializer_list<int>&);
// };
//
// A a{1, 3, 5, 6};
public void testInitListConstRef_549035() throws Exception {
parseAndCheckImplicitNameBindings();
}
// struct type {
// type(int a) {}
// };

View file

@ -400,6 +400,7 @@ public class Conversions {
}
static IType getInitListType(IType target) {
target = getNestedType(target, REF | TDEF | CVTYPE);
if (target instanceof ICPPClassType && target instanceof ICPPTemplateInstance) {
ICPPTemplateInstance inst = (ICPPTemplateInstance) target;
if (CharArrayUtils.equals(INITIALIZER_LIST_NAME, inst.getNameCharArray())) {