c++: recognize class-scope non-template dguides [PR79501]
authorPatrick Palka <ppalka@redhat.com>
Wed, 11 Aug 2021 19:59:22 +0000 (15:59 -0400)
committerPatrick Palka <ppalka@redhat.com>
Wed, 11 Aug 2021 19:59:22 +0000 (15:59 -0400)
commit7e39d1a15f5276f72ee478a692445569bb646e65
treec3c5ef9f887c45f799a65b2f212ab848bcd110e2
parent6186708312780bb2139da01946abdde39667e985
c++: recognize class-scope non-template dguides [PR79501]

It looks like we still don't recognize class-scope non-template
deduction guides even after r12-2260.   This is because deduction guides
are tagged as such in cp_parser_init_declarator after calling
cp_parser_declarator, but in cp_parser_member_declaration we call
cp_parser_declarator directly.

So let's tag them in cp_parser_member_declaration as well.

PR c++/79501

gcc/cp/ChangeLog:

* parser.c (maybe_adjust_declarator_for_dguide): New, split
out from ...
(cp_parser_init_declarator): ... here.
(cp_parser_member_declaration): Use it.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/class-deduction98.C: New test.
gcc/cp/parser.c
gcc/testsuite/g++.dg/cpp1z/class-deduction98.C [new file with mode: 0644]