Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core.tests')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java26
1 files changed, 26 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 111203a785d..eae38c57ac0 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
@@ -13342,4 +13342,30 @@ public class AST2CPPTests extends AST2CPPTestBase {
BindingAssertionHelper helper = getAssertionHelper();
helper.assertVariableValue("is_not_noexcept", 0);
}
+
+ // struct B{
+ // B a;
+ // };
+ // B t{1};
+ public void testSelfAggregation_546805() throws Exception {
+ // Note that ideally we would report an error already on the declaration of B as
+ // the class is aggregating itself. Today, we only report an error because of a
+ // wrong constructor argument.
+ BindingAssertionHelper bh = getAssertionHelper();
+ bh.assertImplicitName("t{1};", 1, IProblemBinding.class);
+ }
+
+ // struct B;
+ // struct A{
+ // B b;
+ // };
+ // struct B{
+ // A a;
+ // };
+ // B t{1};
+ public void testIndirectSelfAggregation_546805() throws Exception {
+ // See comment in previous test
+ BindingAssertionHelper bh = getAssertionHelper();
+ bh.assertImplicitName("t{1};", 1, IProblemBinding.class);
+ }
}

Back to the top