diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java index 7111380ebfa..bd5eca8ddc0 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java @@ -3119,4 +3119,54 @@ public class AST2TemplateTests extends AST2BaseTest { BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true); ICPPTemplateTypeParameter t= ba.assertNonProblem("T)", 1, ICPPTemplateTypeParameter.class); } + + // template + // struct integral_constant { + // static const T1 value = v1; + // typedef T1 value_type; + // typedef integral_constant type; + // }; + // template const T2 integral_constant::value; + // typedef integral_constant true_type; + // typedef integral_constant false_type; + // + // template + // struct if_{ + // typedef A1 type; + // }; + // template + // struct if_ { + // typedef B2 type; + // }; + // + // struct AA { + // int a; + // void method() {} + // }; + // void func(AA oa) {} + // + // struct BB { + // int b; + // void method() {} + // }; + // void func(BB ob) {} + // + // template + // struct CC : public if_::type {}; + // + // void test() { + // CC ca; + // CC cb; + // ca.method(); + // ca.a = 5; + // cb.b = 6; + // func(cb); + // } + public void _testTemplateMetaProgramming_245027() throws Exception { + BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true); + ICPPMethod method= ba.assertNonProblem("method();", 6, ICPPMethod.class); + ICPPVariable a= ba.assertNonProblem("a =", 1, ICPPVariable.class); + ICPPVariable b= ba.assertNonProblem("b =", 1, ICPPVariable.class); + ICPPFunction func= ba.assertNonProblem("func(cb)", 4, ICPPFunction.class); + } }