[Bug c++/84349] [6/7/8 Regression] ICE with auto in function cast
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84349 Bug 84349 depends on bug 84798, which changed state. Bug 84798 Summary: [6/7 Regression] ICE (Segmentation fault) if `auto` appears in a template argument https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84798 What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED
[Bug c++/84349] [6/7/8 Regression] ICE with auto in function cast
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84349 Volker Reichelt changed: What|Removed |Added CC||jason at gcc dot gnu.org Depends on||84798 --- Comment #3 from Volker Reichelt --- This was fixed on trunk by Jason's patch for PR84798. Do we want to add this as a testcase or close it as a duplicate? Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84798 [Bug 84798] [6/7 Regression] ICE (Segmentation fault) if `auto` appears in a template argument
[Bug c++/84349] [6/7/8 Regression] ICE with auto in function cast
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84349 Martin Sebor changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org
[Bug c++/84349] [6/7/8 Regression] ICE with auto in function cast
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84349 Martin Sebor changed: What|Removed |Added Known to work||4.8.4 Known to fail||4.9.4, 5.5.0, 6.4.0, 7.2.0, ||8.0 --- Comment #2 from Martin Sebor --- A slightly simpler test case: void *p = (int(*)(auto))0; The bug seems to be that the auto isn't rejected in this context (namespace scope). The same initializer is rejected in local scope. Accepting it in an initializer expression results in incrementing the processing_template_decl counter in the test case from its initial value of zero to 1. The counter doesn't get decremented back to zero which then triggers the unpaired call to finish_lambda_scope() below: if (!member_p && processing_template_decl) start_lambda_scope (decl); initializer = cp_parser_initializer (parser, _direct_init, _non_constant_init); if (!member_p && processing_template_decl) finish_lambda_scope (); AFAICS, the problem is somewhere in cp_parser_decl_specifier_seq() that creates a decl_specifiers.type for the initializer at global scope for which type_uses_auto() returns null.
[Bug c++/84349] [6/7/8 Regression] ICE with auto in function cast
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84349 Richard Biener changed: What|Removed |Added Priority|P3 |P2 Target Milestone|--- |6.5
[Bug c++/84349] [6/7/8 Regression] ICE with auto in function cast
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84349 Martin Sebor changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2018-02-13 CC||msebor at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Martin Sebor --- Confirmed. The ICE originated with r202540 in GCC 4.9.0: r202540 | abutcher | 2013-09-12 17:04:52 -0400 (Thu, 12 Sep 2013) | 31 lines Support using 'auto' in a function parameter list to introduce an implicit template parameter. Prior to that, GCC would error out with: t.C:2:19: error: parameter declared ‘auto’ int i = (*(int(*)(auto)) p)(0); ^ t.C:2:30: error: too many arguments to function int i = (*(int(*)(auto)) p)(0); ^