c++: Implement CWG 625: Use of auto as template-arg [PR97479]
authorMarek Polacek <polacek@redhat.com>
Mon, 26 Oct 2020 21:35:56 +0000 (17:35 -0400)
committerMarek Polacek <polacek@redhat.com>
Thu, 29 Oct 2020 21:35:56 +0000 (17:35 -0400)
commit11dc4c4e137a9b48d585d7b1b146fb8404e3e1fe
treef38a813180bed2fdf59ebbb03e4dbd9b6cdd1761
parent52215bb3ec6e1bbf44729574ab34ea478f3066b1
c++: Implement CWG 625: Use of auto as template-arg [PR97479]

This patch implements CWG 625 which prohibits using auto in a template
argument.  A few tests used this construction.  Since this usage was
allowed by the Concepts TS, we only give an error in C++20.

gcc/cp/ChangeLog:

DR 625
PR c++/97479
* parser.c (cp_parser_type_id_1): Reject using auto as
a template-argument in C++20.

gcc/testsuite/ChangeLog:

DR 625
PR c++/97479
* g++.dg/cpp0x/auto3.C: Update dg-error.
* g++.dg/cpp0x/auto9.C: Likewise.
* g++.dg/cpp2a/concepts-pr84979-2.C: Likewise.
* g++.dg/cpp2a/concepts-pr84979-3.C: Likewise.
* g++.dg/cpp2a/concepts-pr84979.C: Likewise.
* g++.dg/DRs/dr625.C: New test.
gcc/cp/parser.c
gcc/testsuite/g++.dg/DRs/dr625.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/auto3.C
gcc/testsuite/g++.dg/cpp0x/auto9.C
gcc/testsuite/g++.dg/cpp2a/concepts-pr84979-2.C
gcc/testsuite/g++.dg/cpp2a/concepts-pr84979-3.C
gcc/testsuite/g++.dg/cpp2a/concepts-pr84979.C