aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2024-07-23 13:16:14 -0400
committerThomas Koenig <tkoenig@gcc.gnu.org>2024-07-28 19:05:48 +0200
commit275063836c30229a055861ddbcd725324e91a833 (patch)
treee4d6e755fe62931b72b19d855e34d2381813dd07 /gcc/doc
parentb4b4e9f51b37e5e12f81da5fa0a8fa6db2b3614a (diff)
downloadgcc-275063836c30229a055861ddbcd725324e91a833.zip
gcc-275063836c30229a055861ddbcd725324e91a833.tar.gz
gcc-275063836c30229a055861ddbcd725324e91a833.tar.bz2
c++: normalizing ttp constraints [PR115656]
Here we normalize the constraint same_as<T, bool> for the first time during ttp coercion of B / UU, specifically constraint subsumption checking. During this normalization the set of in-scope template parameters i.e. current_template_parms is empty, which we rely on during normalization of the ttp constraints since we pass in_decl=NULL_TREE to norm_info. And this tricks the satisfaction cache into thinking that the satisfaction value of same_as<T, bool> is independent of its template parameters, and we incorrectly conflate the satisfaction value with T = bool vs T = long and accept the specialization A<long, B>. Since is_compatible_template_arg rewrites the ttp's constraints to be in terms of the argument template's parameters, and since it's the only caller of weakly_subsumes, the latter funcion can instead pass in_decl=tmpl to avoid relying on current_template_parms. This patch implements this, and in turns renames weakly_subsumes to ttp_subsumes to reflect that this predicate is now hardcoded for this one caller. PR c++/115656 gcc/cp/ChangeLog: * constraint.cc (weakly_subsumes): Pass in_decl=tmpl to get_normalized_constraints_from_info. Rename to ... (ttp_subsumes): ... this. * cp-tree.h (weakly_subsumes): Rename to ... (ttp_subsumes): ... this. * pt.cc (is_compatible_template_arg): Adjust after renaming. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-ttp7.C: New test. Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'gcc/doc')
0 files changed, 0 insertions, 0 deletions