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

* [Bug libstdc++/103805] Inconsistent exception specifications
  2021-12-22 11:09 [Bug libstdc++/103805] New: Inconsistent exception specifications martin@mpa-garching.mpg.de
@ 2021-12-22 14:16 ` pinskia at gcc dot gnu.org
  2021-12-22 14:32 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-22 14:16 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |redi at gcc dot gnu.org

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed on the trunk with r12-4963

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

* [Bug libstdc++/103805] Inconsistent exception specifications
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2021-12-22 14:32 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
And r11-9264

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

* [Bug libstdc++/103805] Inconsistent exception specifications
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2021-12-22 14:34 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|11.2.0                      |11.2.1

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Martin Reinecke from comment #0)
> It seems that some functions in the libstdc++ header files shipped with g++
> 11.2.0 have inconsistent exception specification fora few functions.

This is wrong, the problem was never in the 11.2.0 release. You must be using
an 11.2.1 snapshot, and it's already been fixed in the 11.2.1 snapshots since
early November.

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

* [Bug libstdc++/103805] Inconsistent exception specifications
  2021-12-22 11:09 [Bug libstdc++/103805] New: Inconsistent exception specifications martin@mpa-garching.mpg.de
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: martin@mpa-garching.mpg.de @ 2021-12-22 15:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Martin Reinecke <martin@mpa-garching.mpg.de> ---
Sorry if I specified the wrong version. My local (Debian unstable) g++ reports

martin@marvin:~/codes/ducc$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 11.2.0-12'
--with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-11
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib
--enable-libphobos-checking=release --with-target-system-zlib=auto
--enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none=/build/gcc-11-RMIFfM/gcc-11-11.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-RMIFfM/gcc-11-11.2.0/debian/tmp-gcn/usr
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
--with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (Debian 11.2.0-12) 

Not sure how I got the libstdc++ 11.2.1 then, maybe some Debian packaging
issue.

Anyway I"m very glad that this is already fixed!

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

* [Bug libstdc++/103805] Inconsistent exception specifications
  2021-12-22 11:09 [Bug libstdc++/103805] New: Inconsistent exception specifications martin@mpa-garching.mpg.de
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2021-12-22 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |doko at gcc dot gnu.org

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Debian must have backported some changes, but not the fix for this bug. I don't
know why they don't call it 11.2.1, that's what the snapshot numbering is for.

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

* [Bug libstdc++/103805] Inconsistent exception specifications
  2021-12-22 11:09 [Bug libstdc++/103805] New: Inconsistent exception specifications martin@mpa-garching.mpg.de
                   ` (4 preceding siblings ...)
  2021-12-22 15:29 ` redi at gcc dot gnu.org
@ 2021-12-22 15:36 ` martin@mpa-garching.mpg.de
  5 siblings, 0 replies; 7+ messages in thread
From: martin@mpa-garching.mpg.de @ 2021-12-22 15:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Martin Reinecke <martin@mpa-garching.mpg.de> ---
Ouch. That reminds me when Redhat(?) did the same many years ago and caused no
end of confusion. Anyway, sorry for the noise!

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