Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1000398: libstdc++-11-dev: Failed to compile with clang++ C++20 mode due to chenges of std::valarray.

326 views
Skip to first unread message

Kyuma Ohta

unread,
Nov 22, 2021, 9:10:03 AM11/22/21
to
Package: libstdc++-11-dev
Version: 11.2.0-12
Severity: important

Dear Maintainer,

When compiling any C++20 source code using std::valarray with clang++,
failed to compile with below message:
---
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/valarray:foo:var error: exception specification in declaration does not match previous declaration
---

Because /usr/include/c++/11/valarray includes
/usr/include/c++/11/bits/valarray_array.h .

These decl. begin(valarray<_Tp>& __va) variants,
but recent version (11.2.0-12) changes /usr/include/c++/11/valarray
from older version (11.2.0-10) decl. of begin().

These added [[__nodiscard__]] and noexcept to recent version.

These changes violates specificaton P0012R1 after C++17,
clang++ checks this correctly , but g++ (<= 11) not seems to check this.

See,
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html

Best regards,
Ohta.


-- System Information:
Debian Release: bookworm/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'stable-security'), (500, 'unstable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.15.0-1-amd64 (SMP w/12 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libstdc++-11-dev depends on:
ii gcc-11-base 11.2.0-12
ii libc6-dev 2.32-4
ii libgcc-11-dev 11.2.0-12
ii libstdc++6 11.2.0-12

libstdc++-11-dev recommends no packages.

Versions of packages libstdc++-11-dev suggests:
ii libstdc++-11-doc 11.2.0-12

-- no debconf information

K.Ohta

unread,
Nov 30, 2021, 12:20:04 AM11/30/21
to
Dear Nick Lewychy-San,

# Sorry, I missed to choice sender address, Re-Send this.

> Would it be possible to pick up that change?

I cherrypicked this commit to a header of this version ,
then I test to compile with LLVM CLANG(-13) with C++-20,
seems to succeed compilation, not happen FTBFS.
This change seems to be correct.

Regards,
Ohta


On Sat, 27 Nov 2021 22:29:00 -0800 Nick Lewycky <nich...@mxc.ca> wrote:
> You don't even need to use std::valarray, a one-line testcase file
> with "#include <valarray>" fails to compile in clang in C++17 mode or
> newer.
>
> A fix for this issue was committed to libstdc++ on Nov 5th:
> https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=2b2d97fc545635a0f6aa9c9ee3b017394bc494bf
>
> Would it be possible to pick up that change?
>
> Nick
>
>
>
>

Kyuma Ohta

unread,
Nov 30, 2021, 1:30:03 AM11/30/21
to
Dear Nick Lewychy-San,
0 new messages