https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103081
--- Comment #9 from Chris MacGregor <chris-gcc-bugzilla at cybermato dot com> --- With the testcase I just attached, using 13.0.0 20221030 via Godbolt: https://godbolt.org/z/8Y4cr6MxY <source>: In instantiation of 'Event::Event(EventCat, auto:1) [with auto:1 = int]': <source>:38:32: required from here <source>:30:30: internal compiler error: tree check: expected enumeral_type, have record_type in tsubst_copy, at cp/pt.cc:17024 30 | boundsCheck<EventCat>(a_category, kEventCat_Min); // using "EventCat::kEventCat_Min" instead of just "kEventCat_Min" makes this not fail | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~