https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92654
Bug ID: 92654 Summary: internal compiler error: in lookup_template_class_1 Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: fiesh at zefix dot tv Target Milestone: --- The following code results in an internal compiler error in 8, 9, and trunk: namespace a { template <typename b, b> struct c {}; template <typename> using d = int; template <typename b, b...> struct e {}; template <typename b, b g> using h = e<b, __integer_pack(g)...>; } // namespace a template <typename ab, typename i, i... ac> void ad(ab f, a::e<i, ac...>) { (f(a::c<i, ac>{}), ...); } template <auto j, typename ab> void k(ab f) { using i = a::d<decltype(j)>; using l = a::h<i, j>; ad(f, l{}); } template <typename ag, typename ab> void ah(ab f) { auto a{f}; k<m(ag{})>(a); } enum n {}; constexpr int m(n) { return 2; } template <n> struct o; template <template <n, long, n, long> typename> void am() { ah<n>([](auto an) { auto b = decltype(an)(); [b] { if constexpr (o<b>::aq) ; }; }); } template <n, long, n, long> struct p; void as() { am<p>; } % g++ -std=c++17 crash.cpp ... crash.cpp:34:5: internal compiler error: in lookup_template_class_1, at cp/pt.c:9546 Although we ran into the bugs entirely independently, maybe it's related to #92583?