https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89741
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- That is the C++11 wording, e.g. the C++17 wording is: "a hypothetical instantiation of a template immediately following its definition would be ill-formed due to a construct that does not depend on a template parameter" decltype(x) does not depend on the template parameter, just on its type which is known, similarly if you just used sizeof(int)==200. See also https://gcc.gnu.org/gcc-7/porting_to.html#hypothetical-instantiation https://gcc.gnu.org/gcc-8/porting_to.html#hypothetical-instantiation