]> gcc.gnu.org Git - gcc.git/commit
c++: diagnostic for template placeholder in parm [PR106793]
authorJason Merrill <jason@redhat.com>
Fri, 2 Sep 2022 12:45:02 +0000 (08:45 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 7 Sep 2022 17:37:10 +0000 (13:37 -0400)
commitb9cb441c98f265bff86a1c228932524c5fd37dd3
tree9c3d4abb46ab967530bb814cf861843cd32788b0
parent756ccf97cf976011b3800a055bfb9fc3a2c943c6
c++: diagnostic for template placeholder in parm [PR106793]

Talking about the declarator form doesn't help when fixing that would get
you a different error about placeholders not being valid in a parameter.

This also adds a <> fixit, which isn't enough for most templates, but is a
start.

PR c++/106793

gcc/cp/ChangeLog:

* decl.cc (grokdeclarator): Improve placeholder diagnostics.
* parser.cc (cp_parser_type_id_1): Add fixit.

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/auto-array2.C: Adjust.
* g++.dg/cpp1z/class-deduction113.C: New test.
gcc/cp/decl.cc
gcc/cp/parser.cc
gcc/testsuite/g++.dg/cpp1z/class-deduction113.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp23/auto-array2.C
This page took 0.065503 seconds and 6 git commands to generate.