https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84162
Bug ID: 84162 Summary: Internal compiler error: in tsubst, at cp/pt.c:13617 / SEGFAULT Product: gcc Version: 7.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: lumosimann at gmail dot com Target Milestone: --- Created attachment 43316 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43316&action=edit Segfault with flag -DV1 ## Summary Template instantiation leads to internal compile error or segfault. ## GCC version Initially observed on GCC 7.2.1, but reproducible in all versions from 4.7.1 onwards up to 7.3 (compile using godbolt). ## Command g++ -o out compilererror.cpp -std=c++11 -DV1 leads to a segfault and g++ -o out compilererror.cpp -std=c++11 -DV2 leads to an internal compiler error ## Diagnostics # V1: compilererror.cpp: In instantiation of ‘void C::Fail() [with void (C::* f)() = &C::h]’: compilererror.cpp:32:17: required from here compilererror.cpp:25:45: internal compiler error: Segmentation fault typename Object<C, X<int, 3>>::fail<f> a; ^ # V2: compilererror.cpp: In instantiation of ‘void C::Fail() [with SomeEnum <anonymous> = (SomeEnum)0; void (C::* f)() = &C::h]’: compilererror.cpp:34:34: required from here compilererror.cpp:25:45: internal compiler error: in tsubst, at cp/pt.c:13617 typename Object<C, X<int, 3>>::fail<f> a; ^