public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/103805] New: Inconsistent exception specifications
@ 2021-12-22 11:09 martin@mpa-garching.mpg.de
  2021-12-22 14:16 ` [Bug libstdc++/103805] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: martin@mpa-garching.mpg.de @ 2021-12-22 11:09 UTC (permalink / raw)
  To: gcc-bugs

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

            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++ itself
doesn't seem to care, but clang++-13 is unhappy, providing the error message:

clang-13 -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g
-fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -fPIC -DPKGNAME=ducc0 -DPKGVERSION=0.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=c++17 -fvisibility=hidden -g0
-ffast-math -O3 -march=native -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/stl.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/range_access.h:107:31:
note: previous declaration is here
  template<typename _Tp> _Tp* begin(valarray<_Tp>&);
                              ^

At first glance, clang seems to be perfectly right in complaining about this,
but I'm not sure how much libstdc++ is supposed to be interoperable with other
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.

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

end of thread, other threads:[~2021-12-22 15:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-22 11:09 [Bug libstdc++/103805] New: Inconsistent exception specifications martin@mpa-garching.mpg.de
2021-12-22 14:16 ` [Bug libstdc++/103805] " pinskia at gcc dot gnu.org
2021-12-22 14:32 ` redi at gcc dot gnu.org
2021-12-22 14:34 ` redi at gcc dot gnu.org
2021-12-22 15:25 ` martin@mpa-garching.mpg.de
2021-12-22 15:29 ` redi at gcc dot gnu.org
2021-12-22 15:36 ` martin@mpa-garching.mpg.de

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).