On 11/26/18 3:49 PM, Jakub Jelinek wrote:
Hi!
Marek has changed grokdeclarator in r263836, so that in this part of code
it is either a funcdecl_p (previously the only allowed one), which
implies inner_declarator is non-NULL and therefore unqualified_id too,
or newly inner_declarator == NULL. In that case, we IMHO shouldn't be
testing for the deduction guides errors and let it be rejected as before
later.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
2018-11-26 Jakub Jelinek <ja...@redhat.com>
PR c++/88187
* decl.c (grokdeclarator): Don't diagnose deduction guide errors
if inner_declarator is NULL.
* g++.dg/other/pr88187.C: New test.
--- gcc/cp/decl.c.jj 2018-11-17 00:16:41.000000000 +0100
+++ gcc/cp/decl.c 2018-11-26 11:18:30.518620651 +0100
@@ -11276,7 +11276,7 @@ grokdeclarator (const cp_declarator *dec
if (!tmpl)
if (tree late_auto = type_uses_auto (late_return_type))
tmpl = CLASS_PLACEHOLDER_TEMPLATE (late_auto);
- if (tmpl)
+ if (tmpl && inner_declarator)
Let's check funcdecl_p rather than inner_declarator. OK with that change.
Jason