[Bug c++/99803] [9/10/11 Regression] ICE: in make_typename_type, at cp/decl.c:4057

2021-04-16 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99803

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Marek Polacek  ---
Fixed.

[Bug c++/99803] [9/10/11 Regression] ICE: in make_typename_type, at cp/decl.c:4057

2021-04-16 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99803

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Marek Polacek :

https://gcc.gnu.org/g:70f2bff43aadd2fcc0595bf9f4bab72647529655

commit r11-8220-g70f2bff43aadd2fcc0595bf9f4bab72647529655
Author: Marek Polacek 
Date:   Wed Apr 14 17:57:15 2021 -0400

c++: ICE with bogus late return type [PR99803]

Here we ICE when compiling this code in C++20, because we're trying to
slam a 'typename' after the ->.  The cp_parser_template_id call just
before the spot I'm changing parsed A::template A as a BASELINK
that contains a constructor, but make_typename_type crashes on that.

This patch makes make_typename_type more robust instead of checking
for is_overloaded_fn prior calling it.

gcc/cp/ChangeLog:

PR c++/99803
* decl.c (make_typename_type): Give an error and return when
name is is_overloaded_fn.
* parser.c (cp_parser_class_name): Don't check is_overloaded_fn
before calling make_typename_type.

gcc/testsuite/ChangeLog:

PR c++/99803
* g++.dg/cpp2a/typename14.C: Don't expect particular error
messages.
* g++.dg/cpp2a/typename19.C: New test.

[Bug c++/99803] [9/10/11 Regression] ICE: in make_typename_type, at cp/decl.c:4057

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99803

Marek Polacek  changed:

   What|Removed |Added

   Target Milestone|--- |9.4
 CC||mpolacek at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1
   Last reconfirmed||2021-03-29
   Priority|P3  |P2
Summary|ICE: in make_typename_type, |[9/10/11 Regression] ICE:
   |at cp/decl.c:4057   |in make_typename_type, at
   ||cp/decl.c:4057

--- Comment #1 from Marek Polacek  ---
And this one is mine too -- r266710.