aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-im.c
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2021-11-18 19:32:22 -0500
committerPatrick Palka <ppalka@redhat.com>2021-11-18 19:32:22 -0500
commit09c24fe42ff2cef3f3291f5a7540a5835c08430c (patch)
treeda0cb36050d900c15d02daf7c4836de4d5d83b9f /gcc/tree-ssa-loop-im.c
parent483092d3d996c52a16519261ecf4236ab1a2d99c (diff)
downloadgcc-09c24fe42ff2cef3f3291f5a7540a5835c08430c.zip
gcc-09c24fe42ff2cef3f3291f5a7540a5835c08430c.tar.gz
gcc-09c24fe42ff2cef3f3291f5a7540a5835c08430c.tar.bz2
c++: implicit dummy object in requires clause [PR103198]
In the testcase below satisfaction misbehaves for f and g ultimately because find_template_parameters fails to notice that the constraint 'val.x' depends on the template parms of the class template. In contrast, satisfaction works just fine for h. The problem seems to come down to a difference in how any_template_parm_r handles 'this' vs a dummy object: it walks the TREE_TYPE of the former but not the latter, and this causes us to miss the tparm dependencies in f/g's constraints since in their case the implicit object parm through which we access 'val' is a dummy object. (For h, since we know it's a non-static member function when parsing its trailing constraints, the implicit object parm is 'this', not a dummy object.) This patch fixes this inconsistency by making any_template_parm_r walk into the TREE_TYPE of a dummy object, like it already does for 'this'. PR c++/103198 gcc/cp/ChangeLog: * pt.c (any_template_parm_r): Walk the TREE_TYPE of a dummy object. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-this1.C: New test.
Diffstat (limited to 'gcc/tree-ssa-loop-im.c')
0 files changed, 0 insertions, 0 deletions