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

            Bug ID: 91061
           Summary: Enum type libcall_type violates the C++ One Definition
                     Rule
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: jamborm at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-linux
            Target: x86_64-linux

When LTO-bootstrapping GCC with the D language, I get the following
warnings:

/home/mjambor/gcc/mine/src/gcc/d/runtime.cc:37:6: warning: type ‘libcall_type’
violates the C++ One Definition
 Rule [-Wodr]
/home/mjambor/gcc/mine/src/gcc/rtl.h:4112:6: note: an enum with different value
name is defined in another tra
nslation unit

And a quick look confirms that is indeed the case.  Of course, to
truly confuse the linker/LTO, you'd probably need also two functions
with the same name taking a parameter of that one shared name, but I
suppose it would be better not to wait for that to happen and adhere
to C++ rules anyway and rename one of the types.

Steps to reproduce:

Configure with --enable-languages=c,d,c++ and --with-build-config=bootstrap-lto

Run make and then go through the output.

Reply via email to