https://gcc.gnu.org/PR95820 https://bugs.gentoo.org/730406 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -12029,14 +12029,11 @@ grokdeclarator (const cp_declarator *declarator, /* Handle a late-specified return type. */ tree late_return_type = declarator->u.function.late_return_type; - if (funcdecl_p - /* This is the case e.g. for - using T = auto () -> int. */ - || inner_declarator == NULL) + if (true) { if (tree auto_node = type_uses_auto (type)) { - if (!late_return_type) + if (!late_return_type && funcdecl_p) { if (current_class_type && LAMBDA_TYPE_P (current_class_type))