public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95945] New: ICE in poplevel, at cp/decl.c:585
@ 2020-06-28  8:43 haoxintu at gmail dot com
  2020-07-03  3:28 ` [Bug c++/95945] " haoxintu at gmail dot com
  2020-07-08 22:41 ` mpolacek at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: haoxintu at gmail dot com @ 2020-06-28  8:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95945

            Bug ID: 95945
           Summary: ICE in poplevel, at cp/decl.c:585
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

This code, bug.cc, reduce by C-Reduce, makes GCC-trunk ICE.

$cat bug.cc
a ( auto struct { b (

$g++ -w bug.cc
bug.cc:1:17: error: types may not be defined in parameter types
    1 | a ( auto struct { b (
      |                 ^
bug.cc:3: error: expected identifier at end of input
bug.cc:3: error: expected ‘,’ or ‘...’ at end of input
bug.cc:1:22: error: expected ‘)’ at end of input
    1 | a ( auto struct { b (
      |                     ~^
      |                      )
    2 | 
bug.cc:1:19: error: ISO C++ forbids declaration of ‘b’ with no type
[]8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-fpermissive-fpermissive]8;;]
    1 | a ( auto struct { b (
      |                   ^
bug.cc:3: internal compiler error: in poplevel, at cp/decl.c:585
0x6184a0 poplevel(int, int, int)
        ../../gcc/cp/decl.c:585
0x9d75b8 end_template_decl()
        ../../gcc/cp/pt.c:4688
0x989fc2 finish_fully_implicit_template
        ../../gcc/cp/parser.c:44280
0x9cb99a cp_parser_member_declaration
        ../../gcc/cp/parser.c:25414
0x99f921 cp_parser_member_specification_opt
        ../../gcc/cp/parser.c:24850
0x99f921 cp_parser_class_specifier_1
        ../../gcc/cp/parser.c:23947
0x9a1aa3 cp_parser_class_specifier
        ../../gcc/cp/parser.c:24254
0x9a1aa3 cp_parser_type_specifier
        ../../gcc/cp/parser.c:17762
0x9a2a02 cp_parser_decl_specifier_seq
        ../../gcc/cp/parser.c:14410
0x9bf3ef cp_parser_parameter_declaration
        ../../gcc/cp/parser.c:22818
0x9bfdd2 cp_parser_parameter_declaration_list
        ../../gcc/cp/parser.c:22641
0x9c01bc cp_parser_parameter_declaration_clause
        ../../gcc/cp/parser.c:22568
0x9ad617 cp_parser_direct_declarator
        ../../gcc/cp/parser.c:21245
0x9ad617 cp_parser_declarator
        ../../gcc/cp/parser.c:21109
0x9c1ba6 cp_parser_init_declarator
        ../../gcc/cp/parser.c:20609
0x9a36d2 cp_parser_simple_declaration
        ../../gcc/cp/parser.c:13785
0x9cc926 cp_parser_declaration
        ../../gcc/cp/parser.c:13484
0x9cd06a cp_parser_translation_unit
        ../../gcc/cp/parser.c:4761
0x9cd06a c_parse_file()
        ../../gcc/cp/parser.c:44043
0xae4dbb c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1190
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$g++ --version
g++ (GCC) 11.0.0 20200626 (experimental)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

This issue may related to bug 90842, bug 92447, and bug 94829, but according to
the backtrace, I guess it's not the same with them.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/95945] ICE in poplevel, at cp/decl.c:585
  2020-06-28  8:43 [Bug c++/95945] New: ICE in poplevel, at cp/decl.c:585 haoxintu at gmail dot com
@ 2020-07-03  3:28 ` haoxintu at gmail dot com
  2020-07-08 22:41 ` mpolacek at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: haoxintu at gmail dot com @ 2020-07-03  3:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95945

--- Comment #1 from Haoxin Tu <haoxintu at gmail dot com> ---
Add a more meaningful case

$cat p.cc
int a ( auto struct x { int b ();}) {}

$g++ -w p.cc
p.cc:1:23: error: types may not be defined in parameter types
    1 | int a ( auto struct x { int b ();}) {}
      |                       ^
p.cc:1:32: internal compiler error: in poplevel, at cp/decl.c:585
    1 | int a ( auto struct x { int b ();}) {}
      |                                ^
0x683eae poplevel(int, int, int)
        ../../gcc/cp/decl.c:585
0xa45d68 end_template_decl()
        ../../gcc/cp/pt.c:4688
0x9f86c2 finish_fully_implicit_template
        ../../gcc/cp/parser.c:44280
0xa3a12a cp_parser_member_declaration
        ../../gcc/cp/parser.c:25414
0xa0e061 cp_parser_member_specification_opt
        ../../gcc/cp/parser.c:24850
0xa0e061 cp_parser_class_specifier_1
        ../../gcc/cp/parser.c:23947
0xa10213 cp_parser_class_specifier
        ../../gcc/cp/parser.c:24254
0xa10213 cp_parser_type_specifier
        ../../gcc/cp/parser.c:17762
0xa11172 cp_parser_decl_specifier_seq
        ../../gcc/cp/parser.c:14410
0xa2db8f cp_parser_parameter_declaration
        ../../gcc/cp/parser.c:22818
0xa2e582 cp_parser_parameter_declaration_list
        ../../gcc/cp/parser.c:22641
0xa2e95c cp_parser_parameter_declaration_clause
        ../../gcc/cp/parser.c:22568
0xa1bda7 cp_parser_direct_declarator
        ../../gcc/cp/parser.c:21245
0xa1bda7 cp_parser_declarator
        ../../gcc/cp/parser.c:21109
0xa30346 cp_parser_init_declarator
        ../../gcc/cp/parser.c:20609
0xa11e42 cp_parser_simple_declaration
        ../../gcc/cp/parser.c:13785
0xa3b0b6 cp_parser_declaration
        ../../gcc/cp/parser.c:13484
0xa3b7fa cp_parser_translation_unit
        ../../gcc/cp/parser.c:4761
0xa3b7fa c_parse_file()
        ../../gcc/cp/parser.c:44043
0xb5473b c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1190
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

In Clang
$clang++ -w p.cc
p.cc:1:21: error: 'x' cannot be defined in a parameter type
int a ( auto struct x { int b ();}) {}
                    ^
1 error generated.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/95945] ICE in poplevel, at cp/decl.c:585
  2020-06-28  8:43 [Bug c++/95945] New: ICE in poplevel, at cp/decl.c:585 haoxintu at gmail dot com
  2020-07-03  3:28 ` [Bug c++/95945] " haoxintu at gmail dot com
@ 2020-07-08 22:41 ` mpolacek at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-07-08 22:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95945

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P5
                 CC|                            |mpolacek at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-07-08
     Ever confirmed|0                           |1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-08 22:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-28  8:43 [Bug c++/95945] New: ICE in poplevel, at cp/decl.c:585 haoxintu at gmail dot com
2020-07-03  3:28 ` [Bug c++/95945] " haoxintu at gmail dot com
2020-07-08 22:41 ` mpolacek at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).