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

--- Comment #6 from Matt Godbolt <matt at godbolt dot org> ---
This still reproduces on trunk (as of today's CE build anyway):

```
matthew@phoenix ~> /opt/compiler-explorer/gcc-snapshot/bin/g++ --version
g++
(Compiler-Explorer-Build-gcc-eaa6998e9367345605a46c30fb2df9b19789d10e-binutils-2.44)
16.0.1 20260331 (experimental)
Copyright (C) 2026 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

matthew@phoenix ~> /opt/compiler-explorer/gcc-snapshot/bin/g++ -std=c++20 -flto
-Werror=odr -c a.cc -o a.o
                   /opt/compiler-explorer/gcc-snapshot/bin/g++ -std=c++20 -flto
-Werror=odr -c b.cc -o b.o
                   /opt/compiler-explorer/gcc-snapshot/bin/g++ -std=c++20 -flto
-Werror=odr -c main.cc -o main.o
                   /opt/compiler-explorer/gcc-snapshot/bin/g++ -flto
-Werror=odr a.o b.o main.o -o test
a.cc:18:1: error: type ‘struct _ZN12_GLOBAL__N_1L8testCaseIiEE4TaskRT_.Frame’
violates the C++ One Definition Rule [-Werror=odr]
   18 | }
      | ^
b.cc:18:1: note: a different type is defined in another translation unit
   18 | }
      | ^
lto1: note: the first difference of corresponding definitions is field ‘x_1_2’
lto1: note: a field with different name is defined in another translation unit
lto1: some warnings being treated as errors
lto-wrapper: fatal error: /opt/compiler-explorer/gcc-snapshot/bin/g++ returned
1 exit status
compilation terminated.
/opt/compiler-explorer/gcc-trunk-20260401/bin/../lib/gcc/x86_64-linux-gnu/16.0.1/../../../../x86_64-linux-gnu/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status
```

Reply via email to