diff options
author | Patrick Palka <ppalka@redhat.com> | 2025-04-14 11:20:13 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2025-04-14 11:20:13 -0400 |
commit | 00966a7fdb1478b3af5254ff3a80a3ef336c5a94 (patch) | |
tree | b5b28cc4942e9c30053912c03f563e045e4991fa /gcc/rust/rust-gcc.cc | |
parent | 6518799b2dfe8cf6dd7afa96041c5842bb4b9a49 (diff) | |
download | gcc-00966a7fdb1478b3af5254ff3a80a3ef336c5a94.zip gcc-00966a7fdb1478b3af5254ff3a80a3ef336c5a94.tar.gz gcc-00966a7fdb1478b3af5254ff3a80a3ef336c5a94.tar.bz2 |
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<int>::f<U>() ... [with U = int]'
and with this patch we emit:
In substitution of '... void A<int>::f<U>() ... [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 <jason@redhat.com>
Diffstat (limited to 'gcc/rust/rust-gcc.cc')
0 files changed, 0 insertions, 0 deletions