mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 01:05:38 +02:00
Bug 549035 - Constructor with reference to initializer list
Change-Id: I83fd8d2453c36feb51bab80b5bf0943b68a1c97a
This commit is contained in:
parent
4c0e7d9f68
commit
f78158904b
2 changed files with 15 additions and 0 deletions
|
@ -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) {}
|
||||
// };
|
||||
|
|
|
@ -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())) {
|
||||
|
|
Loading…
Add table
Reference in a new issue