c++: Give better placeholder diagnostic
authorJason Merrill <jason@redhat.com>
Thu, 26 Nov 2020 10:45:02 +0000 (05:45 -0500)
committerJason Merrill <jason@redhat.com>
Wed, 2 Dec 2020 21:14:53 +0000 (16:14 -0500)
commit2847d7d28ea79e2f93049fad16f931b6705c9fff
tree098a2060ff83707d5fea5078548813d1094eda7d
parentd9288bd28e24c755a7216311ee5247e7c88270a6
c++: Give better placeholder diagnostic

We were saying 'auto parameter not permitted' in a place where 'auto' is in
fact permitted in C++20, but a class template placeholder is not.

gcc/cp/ChangeLog:

* decl.c (grokdeclarator): Improve diagnostic for
disallowed CTAD placeholder.

gcc/testsuite/ChangeLog:

* g++.dg/other/pr88187.C: Adjust expected error.
* g++.dg/cpp2a/class-deduction-abbrev1.C: New test.
gcc/cp/decl.c
gcc/testsuite/g++.dg/cpp2a/class-deduction-abbrev1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/other/pr88187.C