Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2019-07-07 18:24:18 -0400
committerNathan Ridge2019-07-23 00:49:32 -0400
commitf78158904b16abcb7731c5904a5750edb5bea5da (patch)
tree7155f3d7c65607da4fa69ded382973c87a2490c5
parent4c0e7d9f68c8d2b1ccbb1f9f9c30058bff59cebb (diff)
downloadorg.eclipse.cdt-f78158904b16abcb7731c5904a5750edb5bea5da.tar.gz
org.eclipse.cdt-f78158904b16abcb7731c5904a5750edb5bea5da.tar.xz
org.eclipse.cdt-f78158904b16abcb7731c5904a5750edb5bea5da.zip
Bug 549035 - Constructor with reference to initializer list
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java14
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/Conversions.java1
2 files changed, 15 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
index f38ec70b8b..005478412b 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
@@ -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) {}
// };
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/Conversions.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/Conversions.java
index 61627f970d..b4858bbd4b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/Conversions.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/Conversions.java
@@ -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())) {

Back to the top