https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126882
Bug ID: 126882
Summary: [17 regression] -Wodr in callback-info.h vs plugin.cc
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: build
Severity: normal
Priority: P3
Component: plugins
Assignee: unassigned at gcc dot gnu.org
Reporter: sjames at gcc dot gnu.org
Target Milestone: ---
When building trunk with LTO, I see:
```
/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/work/gcc-17.0.9999/gcc/callback-info.h:28:7:
warning: type ‘struct callback_info’ violates the C++ One Definition Rule
[-Wodr]
28 | class callback_info
| ^
/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/work/gcc-17.0.9999/gcc/plugin.cc:104:8:
note: a different type is defined in another translation unit
104 | struct callback_info
| ^
/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/work/gcc-17.0.9999/gcc/callback-info.h:36:12:
note: the first difference of corresponding definitions is field ‘fn_idx’
36 | unsigned fn_idx;
| ^
/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/work/gcc-17.0.9999/gcc/plugin.cc:106:15:
note: a field with different name is defined in another translation unit
106 | const char *plugin_name; /* Name of plugin that registers the
callback. */
| ^
```