From b9655594c5c6cf2f47b884eab972c1445ab726ad Mon Sep 17 00:00:00 2001 From: "Igor V. Kovalenko" Date: Sat, 22 Apr 2023 09:55:48 +0300 Subject: [PATCH] Amend class template instantiation test for bug 207840 Enabling C++17 deduction guides unconditionally causes one of the tests for template instantiation to fail because one of instantiations can be done via implicit deduction guide using default template arguments. Test case is covering issue https://bugs.eclipse.org/bugs/show_bug.cgi?id=207840 and remaining erroneous cases are not affected. Amend the test and comment about change since C++17. --- .../eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 6fd9a850378..05e61ccd100 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 @@ -3096,14 +3096,14 @@ public void testNonAmbiguityCase_229942() throws Exception { // B b1; // B<> b2; // error - no default args // - // C c1; + // C c1; // OK since C++17 via implicit deduction guide using default template argument // C<> c2; // ok - default args public void testMissingTemplateArgumentLists() throws Exception { BindingAssertionHelper ba = new AST2AssertionHelper(getAboveComment(), CPP); ba.assertProblem("B b1", 1); ba.assertNonProblem("B<> b2", 1, ICPPTemplateDefinition.class, ICPPClassType.class); ba.assertProblem("B<> b2", 3); - ba.assertProblem("C c1", 1); + ba.assertNonProblem("C c1", 1); // OK since C++17 ba.assertNonProblem("C<> c2", 1, ICPPTemplateDefinition.class, ICPPClassType.class); ba.assertNonProblem("C<> c2", 3, ICPPTemplateInstance.class, ICPPClassType.class); }