[Bug c++/97798] FTB msp430-elf error: the value of '__gnu_cxx::__numeric_traits_integer<__int20>::__max' is not usable in a constant expression

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Nov 11 15:51:51 GMT 2020


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

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Reduced.  Nothing MSP430-specific here.

template <typename> struct A;
struct B {
  typedef A<int> type;
};
template <typename T> struct A { static const T max = 1 ? 1 << (T) -1 : 0; };
template <typename T> const T A<T>::max;
class F {};
template <int N> void operator>(F, int) { static_assert(N <= B::type::max); }


More information about the Gcc-bugs mailing list