[Bug c++/101098] New: [11/12 Regression] ICE in instantiate_body, at cp/pt.c:25858

gscfq@t-online.de gcc-bugzilla@gcc.gnu.org
Wed Jun 16 17:19:34 GMT 2021


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

            Bug ID: 101098
           Summary: [11/12 Regression] ICE in instantiate_body, at
                    cp/pt.c:25858
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Changed between 20200621 and 20200628, r9 accepts it.
With option -fconcepts and file g++.dg/cpp2a/concepts-explicit-spec1.C
or the following variant :


$ cat z1.cc
template<typename T> concept C = __is_class(T);
struct Y { int n; } y;
template<C T> void g(T) { }
int called;
template<> void g(Y) { called = 3; }
int main() { g(y); }


$ g++-9 -c z1.cc -fconcepts
$
$ g++-12-20210613 -c z1.cc -fconcepts
z1.cc: In instantiation of 'void g(T) [with T = Y]':
z1.cc:6:15:   required from here
z1.cc:3:27: internal compiler error: Segmentation fault
    3 | template<C T> void g(T) { }
      |                           ^
0xd4d42f crash_signal
        ../../gcc/toplev.c:327
0x822254 instantiate_body
        ../../gcc/cp/pt.c:25858
0x823223 instantiate_decl(tree_node*, bool, bool)
        ../../gcc/cp/pt.c:26141
0x83d9eb instantiate_pending_templates(int)
        ../../gcc/cp/pt.c:26220
0x752232 c_parse_final_cleanups()
        ../../gcc/cp/decl2.c:4966


More information about the Gcc-bugs mailing list