https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86748
Bug ID: 86748 Summary: Terminates abnormally without error messages Product: gcc Version: 7.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: stinkingmadgod at gmail dot com Target Milestone: --- template <int N> struct flag { friend constexpr int adl_flag(flag<N>); }; template <int N> struct write { friend constexpr int adl_flag(flag<N>) { return N; } }; template <int N, bool = noexcept(adl_flag(flag<N>{}))> static constexpr int read(int, flag<N>, int R = read(0, flag<N + 1>{})) { return R; } int main() { read(0, flag<0>{}); } gcc version 7.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project) on Windows 10 Compiled with g++ main.cpp -std=c++17 -Wno-non-template-friend Terminates after ~5x the usual compilation time and before completing (no output) with no error messages. Memory usage goes to ~100MB during which. I'm not certain if this is a bug, but given template instantiation depth exceeded normally generates an error, clang segfaults and MSVC gives up, I thought it might be worth reporting.