From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F35833858C2C; Wed, 22 Dec 2021 11:09:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F35833858C2C From: "martin@mpa-garching.mpg.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/103805] New: Inconsistent exception specifications Date: Wed, 22 Dec 2021 11:09:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: martin@mpa-garching.mpg.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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, 22 Dec 2021 11:09:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103805 Bug ID: 103805 Summary: Inconsistent exception specifications Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: martin@mpa-garching.mpg.de Target Milestone: --- I'm not really sure how to report this one properly, so please let me know = if crucial information is missing! It seems that some functions in the libstdc++ header files shipped with g++ 11.2.0 have inconsistent exception specification fora few functions. g++ it= self doesn't seem to care, but clang++-13 is unhappy, providing the error messag= e: clang-13 -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=3Dformat-security -g -fwrapv -O2 = -g -fstack-protector-strong -Wformat -Werror=3Dformat-security -Wdate-time -D_FORTIFY_SOURCE=3D2 -fPIC -DPKGNAME=3Dducc0 -DPKGVERSION=3D0.22.0 -I. -I.= /src/ -I/home/martin/.local/lib/python3.9/site-packages/pybind11/include -I/home/martin/.local/lib/python3.9/site-packages/pybind11/include -I/usr/include/python3.9 -c python/ducc.cc -o build/temp.linux-x86_64-3.9/python/ducc.o -std=3Dc++17 -fvisibility=3Dhidde= n -g0 -ffast-math -O3 -march=3Dnative -Wfatal-errors -Wfloat-conversion -W -Wall -Wstrict-aliasing -Wwrite-strings -Wredundant-decls -Woverloaded-virtual -Wcast-qual -Wcast-align -Wpointer-arith -pthread In file included from python/ducc.cc:12: In file included from ./python/fft_pymod.cc:41: In file included from /home/martin/.local/lib/python3.9/site-packages/pybind11/include/pybind11/s= tl.h:21: /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/valarray= :1215:5: fatal error: exception specification in declaration does not match previous declaration begin(valarray<_Tp>& __va) noexcept ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/ran= ge_access.h:107:31: note: previous declaration is here template _Tp* begin(valarray<_Tp>&); ^ At first glance, clang seems to be perfectly right in complaining about thi= s, but I'm not sure how much libstdc++ is supposed to be interoperable with ot= her compilers. Anyway, if the C++ standard mandates that all declarations have the same exception specification and g++ just doesn't enforce this at the moment, it might still be good to update the headers to be more future-proof.=