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 7a2cd894921..db21d0cffab 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 @@ -4648,30 +4648,6 @@ public class AST2TemplateTests extends AST2BaseTest { parseAndCheckBindings(code); } - // template void f(Args... args); // #1 - // template void f(T1 a1, Args... args); // #2 - // template void f(T1 a2, T2 a2); // #3 - // void test() { - // f(); // calls #1 - // f(1, 2, 3); // calls #2 - // f(1, 2); // calls #3; non-variadic template #3 is - // } // more specialized than the variadic templates #1 and #2 - public void testVariadicTemplateExamples_280909o() throws Exception { - final String code= getAboveComment(); - parseAndCheckBindings(code); - BindingAssertionHelper bh= new BindingAssertionHelper(code, true); - ICPPFunction f1= bh.assertNonProblem("f(Args... args)", 1); - ICPPFunction f2= bh.assertNonProblem("f(T1 a1, Args... args)", 1); - ICPPFunction f3= bh.assertNonProblem("f(T1 a2, T2 a2)", 1); - - ICPPTemplateInstance x= bh.assertNonProblem("f()", 1); - assertSame(f1, x.getTemplateDefinition()); - x= bh.assertNonProblem("f(1, 2, 3)", 1); - assertSame(f2, x.getTemplateDefinition()); - x= bh.assertNonProblem("f(1, 2)", 1); - assertSame(f3, x.getTemplateDefinition()); - } - // template struct Tuple { }; // void test() { // Tuple<> t0; // Types contains no arguments @@ -4701,7 +4677,7 @@ public class AST2TemplateTests extends AST2BaseTest { // template void f(Types... rest); // template void g(Types... rest) { - // f(&rest...); // ��&rest...�� is a pack expansion, ��&rest�� is its pattern + // f(&rest...); // '&rest...' is a pack expansion, '&rest' is its pattern // } public void testVariadicTemplateExamples_280909r() throws Exception { final String code= getAboveComment(); @@ -4723,10 +4699,10 @@ public class AST2TemplateTests extends AST2BaseTest { // template void f(Args... args) {} // template void h(Args... args) {} // template void g(Args... args) { - // f(const_cast(&args)...); // okay: ��Args�� and ��args�� are expanded + // f(const_cast(&args)...); // okay: 'Args' and 'args' are expanded // f(5 ...); // error: pattern does not contain any parameter packs - // f(args); // error: parameter pack �args� is not expanded - // f(h(args...) + args...); // okay: first ��args�� expanded within h, second ��args�� expanded within f. + // f(args); // error: parameter pack 'args' is not expanded + // f(h(args...) + args...); // okay: first 'args' expanded within h, second 'args' expanded within f. // } public void testVariadicTemplateExamples_280909s() throws Exception { final String code= getAboveComment();