[Bug c++/97399] [9/10/11 Regression] g++ 9.3 cannot compile SFINAE code with separated declaration and definition, g++ 7.3 compiles

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Oct 13 14:10:07 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97399

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aoliva at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Reduced test-case:

$ cat pr97399.ii
template <int __v> struct integral_constant {
  static constexpr int value = __v;
};
template <bool, class> using enable_if_t = int;
struct tmp {
  template <class> static constexpr auto is_integral() -> bool;
  template <class E>
  static auto func(E, E) -> enable_if_t<tmp::is_integral<E>(), bool>;
};
template <class> constexpr auto tmp::is_integral() -> bool {
  return integral_constant<false>::value;
}
int main() { tmp::func(1, 0); }

Started with r9-5972-g10839133ce6c196c.


More information about the Gcc-bugs mailing list