https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89940
Bug ID: 89940 Summary: Template substitution causes segfault Product: gcc Version: 8.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jonehartnett at yahoo dot com Target Milestone: --- Created attachment 46078 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46078&action=edit Preprocessed source file GCC: 8.20 and 7.3.0 System: Ubuntu 18.04 Target: x86_64-linux-gnu Command: gcc main.cpp Output: main.cpp: In substitution of ‘template<int Y> using C = B<int, Y> [with int Y = D<W>()]’: main.cpp:21:13: required from here main.cpp:12:20: internal compiler error: Segmentation fault using C = B<int, Y>; ^ Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-8/README.Bugs> for instructions. The code provided has been simplified to highlight the conditions required to trigger the error. The segfault requires the following properties: * X must be dependent on T * B must be used indirectly through C * Y must be the result of a constexpr * W must be an template parameter to D Changing or omitting any of these conditions (perhaps through manually inlining) does not trigger the segfault.