https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94894
Fabian Knorr <ers.trion at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ers.trion at gmail dot com --- Comment #4 from Fabian Knorr <ers.trion at gmail dot com> --- Not resolved: The patch fixes the tests from Comment 1, but code in the OP remains broken. Here's another reproducer: template<int Dims> struct restrictive { static_assert(Dims != 0); }; template<int Dims> struct permissive { operator restrictive<Dims>() const; }; struct unrelated {}; void fun(unrelated) {} void fun(permissive<0>) {} int main() { fun(permissive<0>{}); } x86_64 gcc 14.2: <source>: In instantiation of 'struct restrictive<0>': <source>:18:8: required from here 18 | fun(permissive<0>{}); | ~~~^~~~~~~~~~~~~~~~~ <source>:3:24: error: static assertion failed 3 | static_assert(Dims != 0); | ~~~~~^~~~ <source>:3:24: note: the comparison reduces to '(0 != 0)'