aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2025-06-06 10:26:28 -0400
committerJason Merrill <jason@redhat.com>2025-06-09 09:22:07 -0400
commite4940c042b753457748e2257a8b13ca3738b4fac (patch)
tree3623072d76ea0dafc875183f250e635015c11162 /gcc/tree-if-conv.c
parent4e4684ca6a79b22fe91acaa81af2d4a00d6e1345 (diff)
downloadgcc-e4940c042b753457748e2257a8b13ca3738b4fac.zip
gcc-e4940c042b753457748e2257a8b13ca3738b4fac.tar.gz
gcc-e4940c042b753457748e2257a8b13ca3738b4fac.tar.bz2
c++: recursive template with deduced return [PR120555]
Here since r15-4120 we were prematurely complaining about the use of func within its own definiton, which is fine at instantiation time. So don't require this for function templates that are currently being defined. But keep the error for instantiations of templates that are not currently being defined, which we similarly did not diagnose before r15-4120 but other implementations do. Both of these follow the general principle from [temp.res.general]/6 that we only error in a template body if no instatiation could be well-formed. Also remove a redundant call to require_deduced_type. PR c++/120555 gcc/cp/ChangeLog: * decl2.cc (fn_being_defined, fn_template_being_defined): New. (mark_used): Check fn_template_being_defined. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/constexpr-if39.C: New test. (cherry picked from commit 8d204f2a536f7253e4251aca7bc12af524800b4c)
Diffstat (limited to 'gcc/tree-if-conv.c')
0 files changed, 0 insertions, 0 deletions