https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124013
Bug ID: 124013
Summary: [16 regression] -Wodr issues in Rust
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: build
Severity: normal
Priority: P3
Component: rust
Assignee: unassigned at gcc dot gnu.org
Reporter: sjames at gcc dot gnu.org
CC: dkm at gcc dot gnu.org, gcc-rust at gcc dot gnu.org,
pierre-emmanuel.patry at embecosm dot com
Target Milestone: ---
With bootstrap-lto (also -O3 and -fno-semantic-interposition, not sure if
either are needed, it might be because of the devirt here):
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/rust/typecheck/rust-tyty.h:477:7:
warning: virtual table of type ‘struct BaseGeneric’ violates one definition
rule [-Wodr]
477 | class BaseGeneric : public BaseType
| ^
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/rust/typecheck/rust-tyty.h:477:7:
note: the conflicting type defined in another translation unit
477 | class BaseGeneric : public BaseType
| ^
<built-in>: note: virtual method ‘__cxa_pure_virtual’
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/rust/typecheck/rust-tyty.h:238:16:
note: ought to match virtual method ‘is_equal’ but does not
238 | virtual bool is_equal (const BaseType &other) const;
| ^
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/rust/typecheck/rust-tyty.h:374:7:
warning: virtual table of type ‘struct CallableTypeInterface’ violates one
definition rule [-Wodr]
374 | class CallableTypeInterface : public BaseType
| ^
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/rust/typecheck/rust-tyty.h:374:7:
note: the conflicting type defined in another translation unit
374 | class CallableTypeInterface : public BaseType
| ^
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/rust/typecheck/rust-tyty.cc:197:1:
note: virtual method ‘is_equal’
197 | BaseType::is_equal (const BaseType &other) const
| ^
<built-in>: note: ought to match virtual method ‘__cxa_pure_virtual’ but does
not
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/rust/hir/tree/rust-hir-item.h:1177:7:
warning: virtual table of type ‘struct Struct’ violates one definition rule
[-Wodr]
1177 | class Struct : public VisItem
| ^
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/rust/hir/tree/rust-hir-item.h:1177:7:
note: the conflicting type defined in another translation unit has virtual
table with more entries
1177 | class Struct : public VisItem
| ^
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/rust/ast/rust-item.h:1637:7:
warning: virtual table of type ‘struct Struct’ violates one definition rule
[-Wodr]
1637 | class Struct : public VisItem
| ^
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/rust/ast/rust-item.h:1637:7:
note: the conflicting type defined in another translation unit has virtual
table with more entries
1637 | class Struct : public VisItem
| ^
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/rust/ast/rust-item.h:2989:7:
warning: virtual table of type ‘struct Impl’ violates one definition rule
[-Wodr]
2989 | class Impl : public VisItem
| ^
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/gcc/rust/ast/rust-item.h:2989:7:
note: the conflicting type defined in another translation unit has virtual
table with more entries
2989 | class Impl : public VisItem
| ^