From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1CACD386102F; Wed, 24 Mar 2021 19:29:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1CACD386102F From: "alexander.lelyakin at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99427] [modules] in system headers: non-constant condition for static assertion Date: Wed, 24 Mar 2021 19:29:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: alexander.lelyakin at googlemail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: nathan at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 19:29:41 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99427 --- Comment #1 from Alexander Lelyakin --- There is a shorter sequence: ---- /usr/local/bin/g++ -std=3Dc++20 -fmodules-ts -x c++-system-header string_vi= ew /usr/local/bin/g++ -std=3Dc++20 -fmodules-ts -x c++-system-header deque /usr/local/bin/g++ -std=3Dc++20 -fmodules-ts -x c++-system-header string /usr/local/bin/g++ -std=3Dc++20 -fmodules-ts -x c++-system-header fstream /usr/local/bin/g++ -std=3Dc++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 =E2=80=98struct std::__atomic_semaphore=E2=80=99: /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-cons= tant condition for static assertion 171 | static_assert(__gnu_cxx::__int_traits<_Tp>::__max | ~~~~~ 172 | <=3D __gnu_cxx::__int_traits::__ma= x); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/c++/11.0.1/bits/semaphore_base.h:172:23: error: the valu= e of =E2=80=98__gnu_cxx::__numeric_traits_integer::__max=E2=80=99 is n= ot 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: =E2=80=98__gnu_cxx::__numeric_traits_integer::__max=E2=80=99 was = not initialized with a constant expression 75 | static const _Value __max =3D __is_signed | ^~~~~ /usr/local/include/c++/11.0.1/condition_variable: warning: not writing modu= le =E2=80=98/usr/local/include/c++/11.0.1/condition_variable=E2=80=99 due to e= rrors ---- 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.=