aboutsummaryrefslogtreecommitdiff
path: root/gcc/range-op-float.cc
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2023-09-08 12:02:20 -0400
committerPatrick Palka <ppalka@redhat.com>2023-09-08 12:02:20 -0400
commit2154bcd6d43cfd821ca70e1583880c4ed955355d (patch)
tree08a66354526ac2493844e746e13c4225acce4e02 /gcc/range-op-float.cc
parentd8bdc978dc9cd4a6210997edacedb954375af70d (diff)
downloadgcc-2154bcd6d43cfd821ca70e1583880c4ed955355d.zip
gcc-2154bcd6d43cfd821ca70e1583880c4ed955355d.tar.gz
gcc-2154bcd6d43cfd821ca70e1583880c4ed955355d.tar.bz2
c++: refine CWG 2369 satisfaction vs non-dep convs [PR99599]
As described in detail in the PR, the CWG 2369 resolution has the surprising consequence of introducing constraint recursion in seemingly valid and innocent code. This patch attempts to fix this surpising behavior for the majority of problematic cases. Rather than checking satisfaction before _all_ non-dependent conversions, as specified by the CWG resolution, this patch makes us first check "safe" non-dependent conversions, then satisfaction, then followed by other non-dependent conversions. A conversion is considered "safe" if computing it is guaranteed to not induce template instantiation, and we conservatively determine this by checking for user-declared constructors (resp. conversion functions) in the parm (resp. arg) class type, roughly. PR c++/99599 gcc/cp/ChangeLog: * pt.cc (check_non_deducible_conversions): Add bool parameter passed down to check_non_deducible_conversion. (fn_type_unification): Call check_non_deducible_conversions an extra time before satisfaction with noninst_only_p=true. (conversion_may_instantiate_p): Define. (check_non_deducible_conversion): Add bool parameter controlling whether to compute only conversions that are guaranteed to not induce template instantiation. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-recursive-sat4.C: Make 'Int' non-aggregate in order to preserve intent of the testcase. * g++.dg/cpp2a/concepts-nondep4.C: New test.
Diffstat (limited to 'gcc/range-op-float.cc')
0 files changed, 0 insertions, 0 deletions