]> gcc.gnu.org Git - gcc.git/commit
c++: Don't try to parse a function declaration as deduction guide [PR97663]
authorJakub Jelinek <jakub@redhat.com>
Tue, 3 Nov 2020 20:42:51 +0000 (21:42 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 20 Apr 2021 23:28:03 +0000 (01:28 +0200)
commitc3a583316776a399fea9eb79019245138a2be181
treeebbba3ac30b2a15d6455b05d1786ed78ec95563a
parent0fbe916a1e4630ef706946f949759c3c0813cf16
c++: Don't try to parse a function declaration as deduction guide [PR97663]

While these function declarations have NULL decl_specifiers->type,
they have still type specifiers specified from which the default int
in the return type is added, so we shouldn't try to parse those as
deduction guides.

2020-11-03  Jakub Jelinek  <jakub@redhat.com>

PR c++/97663
* parser.c (cp_parser_init_declarator): Don't try to parse
C++17 deduction guides if there are any type specifiers even when
type is NULL.

* g++.dg/cpp1z/class-deduction75.C: New test.

(cherry picked from commit cd41e4a1864c10c7f9141284e82e5cc0a3007806)
gcc/cp/parser.c
gcc/testsuite/g++.dg/cpp1z/class-deduction75.C [new file with mode: 0644]
This page took 0.062036 seconds and 6 git commands to generate.