[Bug c++/99214] Incorrect template arguments shown in constraint satisfaction failure diagnostic

2025-04-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99214

--- Comment #4 from GCC Commits  ---
The releases/gcc-14 branch has been updated by Patrick Palka
:

https://gcc.gnu.org/g:3dc43f7f4394f8705090232e3506e1e94f484877

commit r14-11616-g3dc43f7f4394f8705090232e3506e1e94f484877
Author: Patrick Palka 
Date:   Mon Apr 14 11:20:13 2025 -0400

c++: wrong targs in satisfaction diagnostic context line [PR99214]

In the three-parameter version of satisfy_declaration_constraints, when
't' isn't the most general template, then 't' won't correspond with
'args' after we augment the latter via add_outermost_template_args, and
so the instantiation context that we push via push_tinst_level isn't
quite correct: 'args' is a complete set of template arguments, but 't'
is not necessarily the most general template.  This manifests as
misleading diagnostic context lines when issuing a satisfaction failure
error, e.g.  the below testcase without this patch we emit:
  In substitution of '... void A::f() ... [with U = int]'
and with this patch we emit:
  In substitution of '... void A::f() ... [with U = char]'.

This patch fixes this by passing the original 'args' to push_tinst_level,
which ought to properly correspond to 't'.

PR c++/99214

gcc/cp/ChangeLog:

* constraint.cc (satisfy_declaration_constraints): Pass the
original ARGS to push_tinst_level.

gcc/testsuite/ChangeLog:

* g++.dg/concepts/diagnostic20.C: New test.

Reviewed-by: Jason Merrill 
(cherry picked from commit 00966a7fdb1478b3af5254ff3a80a3ef336c5a94)

[Bug c++/99214] Incorrect template arguments shown in constraint satisfaction failure diagnostic

2025-04-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99214

--- Comment #3 from GCC Commits  ---
The master branch has been updated by Patrick Palka :

https://gcc.gnu.org/g:00966a7fdb1478b3af5254ff3a80a3ef336c5a94

commit r15-9433-g00966a7fdb1478b3af5254ff3a80a3ef336c5a94
Author: Patrick Palka 
Date:   Mon Apr 14 11:20:13 2025 -0400

c++: wrong targs in satisfaction diagnostic context line [PR99214]

In the three-parameter version of satisfy_declaration_constraints, when
't' isn't the most general template, then 't' won't correspond with
'args' after we augment the latter via add_outermost_template_args, and
so the instantiation context that we push via push_tinst_level isn't
quite correct: 'args' is a complete set of template arguments, but 't'
is not necessarily the most general template.  This manifests as
misleading diagnostic context lines when issuing a satisfaction failure
error, e.g.  the below testcase without this patch we emit:
  In substitution of '... void A::f() ... [with U = int]'
and with this patch we emit:
  In substitution of '... void A::f() ... [with U = char]'.

This patch fixes this by passing the original 'args' to push_tinst_level,
which ought to properly correspond to 't'.

PR c++/99214

gcc/cp/ChangeLog:

* constraint.cc (satisfy_declaration_constraints): Pass the
original ARGS to push_tinst_level.

gcc/testsuite/ChangeLog:

* g++.dg/concepts/diagnostic20.C: New test.

Reviewed-by: Jason Merrill 

[Bug c++/99214] Incorrect template arguments shown in constraint satisfaction failure diagnostic

2021-09-01 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99214

Patrick Palka  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |ppalka at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

[Bug c++/99214] Incorrect template arguments shown in constraint satisfaction failure diagnostic

2021-08-12 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99214

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2021-08-12

--- Comment #2 from Andrew Pinski  ---
Confirmed.

[Bug c++/99214] Incorrect template arguments shown in constraint satisfaction failure diagnostic

2021-02-22 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99214

--- Comment #1 from Patrick Palka  ---
Changed with r11-2774.