[Bug plugins/126882] New: [17 regression] -Wodr in callback-info.h vs plugin.cc

"sjames at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
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.  */
      |               ^
```
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.