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

            Bug ID: 101898
           Summary: [concepts] ICE with auto in concept definition
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet (compiled with "-fconcepts")
triggers an ICE since GCC 6.1.0 (when concepts were introduced):

================================================
template<typename> concept bool C
  = requires(int i, void(f)(auto)) { true; };
================================================

bug.cc:2:45: internal compiler error: in pop_local_binding, at
cp/name-lookup.c:2496
    2 |   = requires(int i, void(f)(auto)) { true; };
      |                                             ^
0x6c5612 pop_local_binding(tree_node*, tree_node*)
        ../../gcc/gcc/cp/name-lookup.c:2496
0x6c5612 pop_local_binding(tree_node*, tree_node*)
        ../../gcc/gcc/cp/name-lookup.c:2484
0x9d6279 poplevel(int, int, int)
        ../../gcc/gcc/cp/decl.c:731
0xadc2a8 end_template_decl()
        ../../gcc/gcc/cp/pt.c:4738
0xaccc23 cp_parser_template_declaration_after_parameters
        ../../gcc/gcc/cp/parser.c:30992
0xacd2a0 cp_parser_explicit_template_declaration
        ../../gcc/gcc/cp/parser.c:31232
0xacfd69 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:14718
0xad078e cp_parser_toplevel_declaration
        ../../gcc/gcc/cp/parser.c:14808
0xad078e cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4978
0xad078e c_parse_file()
        ../../gcc/gcc/cp/parser.c:46558
0xbf924d c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1223
Please submit a full bug report, [etc.]

Reply via email to