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

            Bug ID: 97798
           Summary: FTB msp430-elf error: the value of
                    '__gnu_cxx::__numeric_traits_integer<__int20>::__max'
                    is not usable in a constant expression
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jozefl at gcc dot gnu.org
  Target Milestone: ---

GCC fails to build for msp430-elf since:

commit c2856ceec2e7542fe9b0bf104afeeeeb57d6996d
Author: Marek Polacek <pola...@redhat.com>
Date:   Thu Oct 29 15:19:51 2020 -0400

    c++: Tweaks for value_dependent_expression_p.

There is an error building libstdc++ for the -mlarge multilib, which uses
__int20 pointers:

> In file included from 
> /home/jozef/msp430/gcc/build-msp430/msp430-elf/large/libstdc++-v3/include/sstream:38,
>                  from 
> ../../../../../../libstdc++-v3/src/c++20/sstream-inst.cc:30:
> /home/jozef/msp430/gcc/build-msp430/msp430-elf/large/libstdc++-v3/include/istream:
>  In function 'std::basic_istream<_CharT, _Traits>& 
> std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT (&)[_Num])':
> /home/jozef/msp430/gcc/build-msp430/msp430-elf/large/libstdc++-v3/include/istream:840:26:
>  error: non-constant condition for static assertion
>   840 |       static_assert(_Num <= 
> __gnu_cxx::__numeric_traits<streamsize>::__max);
>       |                     
> ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/jozef/msp430/gcc/build-msp430/msp430-elf/large/libstdc++-v3/include/istream:840:26:
>  error: the value of '__gnu_cxx::__numeric_traits_integer<__int20>::__max' is 
> not usable in a constant expression
> In file included from 
> /home/jozef/msp430/gcc/build-msp430/msp430-elf/large/libstdc++-v3/include/bits/stl_algobase.h:63,
>                  from 
> /home/jozef/msp430/gcc/build-msp430/msp430-elf/large/libstdc++-v3/include/bits/char_traits.h:39,
>                  from 
> /home/jozef/msp430/gcc/build-msp430/msp430-elf/large/libstdc++-v3/include/ios:40,
>                  from 
> /home/jozef/msp430/gcc/build-msp430/msp430-elf/large/libstdc++-v3/include/istream:38,
>                  from 
> /home/jozef/msp430/gcc/build-msp430/msp430-elf/large/libstdc++-v3/include/sstream:38,
>                  from 
> ../../../../../../libstdc++-v3/src/c++20/sstream-inst.cc:30:
> /home/jozef/msp430/gcc/build-msp430/msp430-elf/large/libstdc++-v3/include/ext/numeric_traits.h:78:27:
>  note: '__gnu_cxx::__numeric_traits_integer<__int20>::__max' was not 
> initialized with a constant expression
>    78 |       static const _Value __max = __glibcxx_max(_Value);
>       |                           ^~~~~
> make[9]: *** [Makefile:550: sstream-inst.lo] Error 1

Configured with:
> ../configure --target=msp430-elf --enable-languages=c,c++ --disable-nls 
> --disable-no-exceptions --disable-full-memory-range

Reply via email to