Skip to content

Commit

Permalink
Amend class template instantiation test for bug 207840
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
i-garrison authored and jonahgraham committed Apr 25, 2023
1 parent a1c904f commit b965559
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit b965559

Please sign in to comment.