aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2024-06-07 12:12:30 -0400
committerPatrick Palka <ppalka@redhat.com>2024-06-07 12:12:30 -0400
commit5c761395402a730535983a5e49ef1775561ebc61 (patch)
treed21e2b34b51212f658e2de914b38d14385346743 /libcpp
parenta3d68b5155018817dd7eef5abbaeadf3959b8e5e (diff)
downloadgcc-5c761395402a730535983a5e49ef1775561ebc61.zip
gcc-5c761395402a730535983a5e49ef1775561ebc61.tar.gz
gcc-5c761395402a730535983a5e49ef1775561ebc61.tar.bz2
c++: lambda in pack expansion [PR115378]
Here find_parameter_packs_r is incorrectly treating the 'auto' return type of a lambda as a parameter pack due to Concepts-TS specific logic added in r6-4517, leading to confusion later when expanding the pattern. Since we intend on removing Concepts TS support soon anyway, this patch fixes this by restricting the problematic logic with flag_concepts_ts. Doing so revealed that add_capture was relying on this logic to set TEMPLATE_TYPE_PARAMETER_PACK for the 'auto' type of an pack expansion init-capture, which we now need to do explicitly. PR c++/115378 gcc/cp/ChangeLog: * lambda.cc (lambda_capture_field_type): Set TEMPLATE_TYPE_PARAMETER_PACK on the auto type of an init-capture pack expansion. * pt.cc (find_parameter_packs_r) <case TEMPLATE_TYPE_PARM>: Restrict TEMPLATE_TYPE_PARAMETER_PACK promotion with flag_concepts_ts. gcc/testsuite/ChangeLog: * g++.dg/cpp1y/decltype-auto-103497.C: Adjust expected diagnostic. * g++.dg/template/pr95672.C: Likewise. * g++.dg/cpp2a/lambda-targ5.C: New test. Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions