c++: Parameter pack in requires parameter list [PR94808]
authorPatrick Palka <ppalka@redhat.com>
Wed, 29 Apr 2020 01:45:54 +0000 (21:45 -0400)
committerPatrick Palka <ppalka@redhat.com>
Wed, 29 Apr 2020 01:45:54 +0000 (21:45 -0400)
commit43439d5e8424f3a746003ef8953e1cdc120fbbd7
tree04b68af12b869de33fd41fbfaaca1673ff5d275c
parent50a2f53562bfbf0cdc37be5d6fd7fd9e6271dba7
c++: Parameter pack in requires parameter list [PR94808]

When printing the substituted parameter list of a requires-expression as
part of the "in requirements with ..." context line during concepts
diagnostics, we weren't considering that substitution into a parameter
pack can yield zero or multiple parameters.

This patch changes the way we print the parameter list of a
requires-expression in print_requires_expression_info.  We now print the
dependent form of the parameter list (along with its template parameter
mapping) instead of printing its substituted form.  Besides being an
improvement in its own, this also sidesteps the substitution issue in the
PR altogether.

gcc/cp/ChangeLog:

PR c++/94808
* error.c (print_requires_expression_info): Print the dependent
form of the parameter list with its template parameter mapping,
rather than printing the substituted form.

gcc/testsuite/ChangeLog:

PR c++/94808
* g++.dg/concepts/diagnostic12.C: New test.
* g++.dg/concepts/diagnostic5.C: Adjust dg-message.
gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/concepts/diagnostic12.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/diagnostic5.C