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

            Bug ID: 123183
           Summary: [16 regression] MinGW-w64 std::print link error since
                    r16-6038-g62c126db6b6
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: c at cyano dot cn
  Target Milestone: ---

When compiling the simple program:

```
#include <print>
int main()
{
    std::println("{}", "hello");
}
```

with the command `x86_64-w64-mingw32-g++ -std=c++23 -static test.cc
-lstdc++exp`, there are many link errors:

> .../ld: .../libstdc++.a(bad_alloc.o): in function `std::bad_alloc::what() 
> const':
> .../libstdc++-v3/libsupc++/bad_alloc.cc:34: multiple definition of 
> `std::bad_alloc::what() const'; 
> .../libstdc++exp.a(print.o):.../libstdc++-v3/include/bits/new_except.h:70: 
> first defined here
> (and so on...)

GCC is configured with: (host: Arch Linux)

```
Using built-in specs.
COLLECT_GCC=x86_64-w64-mingw32-g++
COLLECT_LTO_WRAPPER=/opt/gcc-mingw/libexec/gcc/x86_64-w64-mingw32/16.0.0/lto-wrapper
Target: x86_64-w64-mingw32
Configured with: ../configure --prefix=/opt/gcc-mingw
--target=x86_64-w64-mingw32 --disable-bootstrap --disable-multilib
--enable-languages=c,c++ --enable-threads=posix
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20251211 (experimental) (GCC)
```

Reply via email to