diff options
author | Patrick Palka <ppalka@redhat.com> | 2021-04-23 08:47:02 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2021-04-23 08:47:02 -0400 |
commit | 87fc34a461cf362947a430d8a241f653fd83bc7b (patch) | |
tree | 14ddc556452e0d0c2345ecda011b16cd71b70cc6 /gcc/tree-complex.c | |
parent | 5f8aed72e76970d2c6fa06fb23fdaa47660555b0 (diff) | |
download | gcc-87fc34a461cf362947a430d8a241f653fd83bc7b.zip gcc-87fc34a461cf362947a430d8a241f653fd83bc7b.tar.gz gcc-87fc34a461cf362947a430d8a241f653fd83bc7b.tar.bz2 |
c++: Fix pretty printing pointer to function type [PR98767]
When pretty printing a pointer to function type,
pp_cxx_parameter_declaration_clause ends up always outputting an empty
function parameter list because the loop that outputs the list iterates
over 'args' instead of 'types', and 'args' is empty when a FUNCTION_TYPE
is passed to this routine (as opposed to a FUNCTION_DECL).
This patch fixes this by making the loop iterate over 'types' instead.
This patch also moves the retrofitted chain-of-PARM_DECLs printing from
here to pp_cxx_requires_expr, the only caller that uses it. Doing so
lets us easily output the trailing '...' in the parameter list of a
variadic function, which this patch also implements.
gcc/cp/ChangeLog:
PR c++/98767
* cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
Adjust parameter list loop to iterate over 'types' instead of
'args'. Output the trailing '...' for a variadic function.
Remove PARM_DECL support.
(pp_cxx_requires_expr): Pretty print the parameter list directly
instead of going through pp_cxx_parameter_declaration_clause.
gcc/testsuite/ChangeLog:
PR c++/98767
* g++.dg/concepts/diagnostic17.C: New test.
Diffstat (limited to 'gcc/tree-complex.c')
0 files changed, 0 insertions, 0 deletions