1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

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.
This commit is contained in:
Igor V. Kovalenko 2023-04-22 09:55:48 +03:00 committed by Jonah Graham
parent a1c904fbc7
commit b9655594c5

View file

@ -3096,14 +3096,14 @@ public class AST2TemplateTests extends AST2CPPTestBase {
// 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);
}