https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105912
--- Comment #1 from Luke Dalessandro <ldalessandro at gmail dot com> --- Somewhat reduced testcase: template <wchar_t> struct A {}; template <wchar_t> struct B {}; template <wchar_t a> static consteval auto operator~(A<a>) -> B<a> { return {}; } A<'i'> i; template <class> auto test() -> bool { auto ii = ~i; // ICE HERE return true; } int main() { bool i = test<int>(); } https://godbolt.org/z/rEf4neexc