public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99427] New: [modules] in system headers: non-constant condition for static assertion
@ 2021-03-06  7:56 alexander.lelyakin at googlemail dot com
  2021-03-24 19:29 ` [Bug c++/99427] " alexander.lelyakin at googlemail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: alexander.lelyakin at googlemail dot com @ 2021-03-06  7:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99427
           Summary: [modules] in system headers: non-constant condition
                    for static assertion
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alexander.lelyakin at googlemail dot com
  Target Milestone: ---

g++ -std=c++20 -fmodules-ts -x c++-system-header optional
g++ -std=c++20 -fmodules-ts -x c++-system-header random
g++ -std=c++20 -fmodules-ts -x c++-system-header memory_resource
g++ -std=c++20 -fmodules-ts -x c++-system-header string_view
g++ -std=c++20 -fmodules-ts -x c++-system-header thread
g++ -std=c++20 -fmodules-ts -x c++-system-header cwchar
g++ -std=c++20 -fmodules-ts -x c++-system-header forward_list
g++ -std=c++20 -fmodules-ts -x c++-system-header unordered_map
g++ -std=c++20 -fmodules-ts -x c++-system-header tuple
g++ -std=c++20 -fmodules-ts -x c++-system-header ios
g++ -std=c++20 -fmodules-ts -x c++-system-header istream
----
/usr/local/include/c++/11.0.1/istream: In function ‘std::basic_istream<_CharT,
_Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT
(&)[_Num])’:
/usr/local/include/c++/11.0.1/istream:840:26: error: non-constant condition for
static assertion
  840 |       static_assert(_Num <=
__gnu_cxx::__numeric_traits<streamsize>::__max);
      |                    
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/11.0.1/istream:840:26: error: the value of
‘__gnu_cxx::__numeric_traits_integer<long int>::__max’ is not usable in a
constant expression
In file included from /usr/local/include/c++/11.0.1/bits/stl_algobase.h:63,
                 from /usr/local/include/c++/11.0.1/bits/char_traits.h:39,
                 from /usr/local/include/c++/11.0.1/string_view:41,
of module /usr/local/include/c++/11.0.1/string_view, imported at
/usr/local/include/c++/11.0.1/bits/basic_string.h:48,
        included from /usr/local/include/c++/11.0.1/string:55,
                 from /usr/local/include/c++/11.0.1/bits/locale_classes.h:40,
                 from /usr/local/include/c++/11.0.1/bits/ios_base.h:41,
                 from /usr/local/include/c++/11.0.1/ios:42,
of module /usr/local/include/c++/11.0.1/ios, imported at
/usr/local/include/c++/11.0.1/istream:38:
/usr/local/include/c++/11.0.1/ext/numeric_traits.h:75:27: note:
‘__gnu_cxx::__numeric_traits_integer<long int>::__max’ was not initialized with
a constant expression
   75 |       static const _Value __max = __is_signed
      |                           ^~~~~
/usr/local/include/c++/11.0.1/istream: At global scope:
/usr/local/include/c++/11.0.1/istream: warning: not writing module
‘/usr/local/include/c++/11.0.1/istream’ due to errors
----
g++ (GCC) 11.0.1 20210305 (experimental)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/99427] [modules] in system headers: non-constant condition for static assertion
  2021-03-06  7:56 [Bug c++/99427] New: [modules] in system headers: non-constant condition for static assertion alexander.lelyakin at googlemail dot com
@ 2021-03-24 19:29 ` alexander.lelyakin at googlemail dot com
  2021-03-27  6:54 ` alexander.lelyakin at googlemail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: alexander.lelyakin at googlemail dot com @ 2021-03-24 19:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Alexander Lelyakin <alexander.lelyakin at googlemail dot com> ---
There is a shorter sequence:
----
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header string_view
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header deque
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header string
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header fstream
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header
condition_variable
----
In file included from /usr/local/include/c++/11.0.1/semaphore:35,
                 from /usr/local/include/c++/11.0.1/stop_token:37,
                 from /usr/local/include/c++/11.0.1/condition_variable:47:
/usr/local/include/c++/11.0.1/bits/semaphore_base.h: In instantiation of
‘struct std::__atomic_semaphore<int>’:
/usr/local/include/c++/11.0.1/bits/semaphore_base.h:292:45:   required from
here
/usr/local/include/c++/11.0.1/bits/semaphore_base.h:172:23: error: non-constant
condition for static assertion
  171 |       static_assert(__gnu_cxx::__int_traits<_Tp>::__max
      |                                                   ~~~~~
  172 |                       <= __gnu_cxx::__int_traits<ptrdiff_t>::__max);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/11.0.1/bits/semaphore_base.h:172:23: error: the value of
‘__gnu_cxx::__numeric_traits_integer<long int>::__max’ is not usable in a
constant expression
In file included from /usr/local/include/c++/11.0.1/bits/stl_algobase.h:63,
                 from /usr/local/include/c++/11.0.1/bits/char_traits.h:39,
                 from /usr/local/include/c++/11.0.1/string_view:41,
of module /usr/local/include/c++/11.0.1/string_view, imported at
/usr/local/include/c++/11.0.1/bits/basic_string.h:48,
        included from /usr/local/include/c++/11.0.1/string:55,
of module /usr/local/include/c++/11.0.1/string, imported at
/usr/local/include/c++/11.0.1/stdexcept:39,
        included from /usr/local/include/c++/11.0.1/system_error:41,
                 from /usr/local/include/c++/11.0.1/bits/std_mutex.h:39,
                 from /usr/local/include/c++/11.0.1/condition_variable:40:
/usr/local/include/c++/11.0.1/ext/numeric_traits.h:75:27: note:
‘__gnu_cxx::__numeric_traits_integer<long int>::__max’ was not initialized with
a constant expression
   75 |       static const _Value __max = __is_signed
      |                           ^~~~~
/usr/local/include/c++/11.0.1/condition_variable: warning: not writing module
‘/usr/local/include/c++/11.0.1/condition_variable’ due to errors
----
g++ (GCC) 11.0.1 20210324 (experimental)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/99427] [modules] in system headers: non-constant condition for static assertion
  2021-03-06  7:56 [Bug c++/99427] New: [modules] in system headers: non-constant condition for static assertion alexander.lelyakin at googlemail dot com
  2021-03-24 19:29 ` [Bug c++/99427] " alexander.lelyakin at googlemail dot com
@ 2021-03-27  6:54 ` alexander.lelyakin at googlemail dot com
  2021-03-30  1:34 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: alexander.lelyakin at googlemail dot com @ 2021-03-27  6:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Alexander Lelyakin <alexander.lelyakin at googlemail dot com> ---
There is a shorter sequence:

/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header string_view
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header ios
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header
initializer_list
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header sstream
----
In file included from /usr/local/include/c++/11.0.1/sstream:38:
/usr/local/include/c++/11.0.1/istream: In function ‘std::basic_istream<_CharT,
_Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT
(&)[_Num])’:
/usr/local/include/c++/11.0.1/istream:840:26: error: non-constant condition for
static assertion
  840 |       static_assert(_Num <=
__gnu_cxx::__numeric_traits<streamsize>::__max);
      |                    
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/11.0.1/istream:840:26: error: the value of
‘__gnu_cxx::__numeric_traits_integer<long int>::__max’ is not usable in a
constant expression
In file included from /usr/local/include/c++/11.0.1/bits/stl_algobase.h:63,
                 from /usr/local/include/c++/11.0.1/bits/char_traits.h:39,
                 from /usr/local/include/c++/11.0.1/string_view:41,
of module /usr/local/include/c++/11.0.1/string_view, imported at
/usr/local/include/c++/11.0.1/bits/basic_string.h:48,
        included from /usr/local/include/c++/11.0.1/string:55,
                 from /usr/local/include/c++/11.0.1/bits/locale_classes.h:40,
                 from /usr/local/include/c++/11.0.1/bits/ios_base.h:41,
                 from /usr/local/include/c++/11.0.1/ios:42,
of module /usr/local/include/c++/11.0.1/ios, imported at
/usr/local/include/c++/11.0.1/istream:38,
        included from /usr/local/include/c++/11.0.1/sstream:38:
/usr/local/include/c++/11.0.1/ext/numeric_traits.h:75:27: note:
‘__gnu_cxx::__numeric_traits_integer<long int>::__max’ was not initialized with
a constant expression
   75 |       static const _Value __max = __is_signed
      |                           ^~~~~
/usr/local/include/c++/11.0.1/sstream: At global scope:
/usr/local/include/c++/11.0.1/sstream: warning: not writing module
‘/usr/local/include/c++/11.0.1/sstream’ due to errors
----
g++ (GCC) 11.0.1 20210326 (experimental)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/99427] [modules] in system headers: non-constant condition for static assertion
  2021-03-06  7:56 [Bug c++/99427] New: [modules] in system headers: non-constant condition for static assertion alexander.lelyakin at googlemail dot com
  2021-03-24 19:29 ` [Bug c++/99427] " alexander.lelyakin at googlemail dot com
  2021-03-27  6:54 ` alexander.lelyakin at googlemail dot com
@ 2021-03-30  1:34 ` mpolacek at gcc dot gnu.org
  2021-03-30  6:47 ` alexander.lelyakin at googlemail dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-03-30  1:34 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org
   Last reconfirmed|                            |2021-03-30
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/99427] [modules] in system headers: non-constant condition for static assertion
  2021-03-06  7:56 [Bug c++/99427] New: [modules] in system headers: non-constant condition for static assertion alexander.lelyakin at googlemail dot com
                   ` (2 preceding siblings ...)
  2021-03-30  1:34 ` mpolacek at gcc dot gnu.org
@ 2021-03-30  6:47 ` alexander.lelyakin at googlemail dot com
  2021-03-30 20:35 ` alexander.lelyakin at googlemail dot com
  2021-03-30 20:36 ` mpolacek at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: alexander.lelyakin at googlemail dot com @ 2021-03-30  6:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Alexander Lelyakin <alexander.lelyakin at googlemail dot com> ---
There is a shorter sequence:

/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header string_view
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header ios
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header ccomplex
----
In file included from /usr/local/include/c++/11.0.1/sstream:38,
                 from /usr/local/include/c++/11.0.1/complex:45,
                 from /usr/local/include/c++/11.0.1/ccomplex:39:
/usr/local/include/c++/11.0.1/istream: In function ‘std::basic_istream<_CharT,
_Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT
(&)[_Num])’:
/usr/local/include/c++/11.0.1/istream:840:26: error: non-constant condition for
static assertion
  840 |       static_assert(_Num <=
__gnu_cxx::__numeric_traits<streamsize>::__max);
      |                    
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/11.0.1/istream:840:26: error: the value of
‘__gnu_cxx::__numeric_traits_integer<long int>::__max’ is not usable in a
constant expression
In file included from /usr/local/include/c++/11.0.1/bits/stl_algobase.h:63,
                 from /usr/local/include/c++/11.0.1/bits/char_traits.h:39,
                 from /usr/local/include/c++/11.0.1/string_view:41,
of module /usr/local/include/c++/11.0.1/string_view, imported at
/usr/local/include/c++/11.0.1/bits/basic_string.h:48,
        included from /usr/local/include/c++/11.0.1/string:55,
                 from /usr/local/include/c++/11.0.1/bits/locale_classes.h:40,
                 from /usr/local/include/c++/11.0.1/bits/ios_base.h:41,
                 from /usr/local/include/c++/11.0.1/ios:42,
of module /usr/local/include/c++/11.0.1/ios, imported at
/usr/local/include/c++/11.0.1/istream:38,
        included from /usr/local/include/c++/11.0.1/sstream:38,
                 from /usr/local/include/c++/11.0.1/complex:45,
                 from /usr/local/include/c++/11.0.1/ccomplex:39:
/usr/local/include/c++/11.0.1/ext/numeric_traits.h:75:27: note:
‘__gnu_cxx::__numeric_traits_integer<long int>::__max’ was not initialized with
a constant expression
   75 |       static const _Value __max = __is_signed
      |                           ^~~~~
/usr/local/include/c++/11.0.1/ccomplex: At global scope:
/usr/local/include/c++/11.0.1/ccomplex: warning: not writing module
‘/usr/local/include/c++/11.0.1/ccomplex’ due to errors
----
g++ (GCC) 11.0.1 20210329 (experimental)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/99427] [modules] in system headers: non-constant condition for static assertion
  2021-03-06  7:56 [Bug c++/99427] New: [modules] in system headers: non-constant condition for static assertion alexander.lelyakin at googlemail dot com
                   ` (3 preceding siblings ...)
  2021-03-30  6:47 ` alexander.lelyakin at googlemail dot com
@ 2021-03-30 20:35 ` alexander.lelyakin at googlemail dot com
  2021-03-30 20:36 ` mpolacek at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: alexander.lelyakin at googlemail dot com @ 2021-03-30 20:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Alexander Lelyakin <alexander.lelyakin at googlemail dot com> ---
Not reproduced anymore

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/99427] [modules] in system headers: non-constant condition for static assertion
  2021-03-06  7:56 [Bug c++/99427] New: [modules] in system headers: non-constant condition for static assertion alexander.lelyakin at googlemail dot com
                   ` (4 preceding siblings ...)
  2021-03-30 20:35 ` alexander.lelyakin at googlemail dot com
@ 2021-03-30 20:36 ` mpolacek at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-03-30 20:36 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed then.  Thanks for checking!

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-30 20:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-06  7:56 [Bug c++/99427] New: [modules] in system headers: non-constant condition for static assertion alexander.lelyakin at googlemail dot com
2021-03-24 19:29 ` [Bug c++/99427] " alexander.lelyakin at googlemail dot com
2021-03-27  6:54 ` alexander.lelyakin at googlemail dot com
2021-03-30  1:34 ` mpolacek at gcc dot gnu.org
2021-03-30  6:47 ` alexander.lelyakin at googlemail dot com
2021-03-30 20:35 ` alexander.lelyakin at googlemail dot com
2021-03-30 20:36 ` mpolacek at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).