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

            Bug ID: 101118
           Summary: coroutines: unexpected ODR warning for coroutine frame
                    type in LTO builds
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nilsgladitz at gmail dot com
  Target Milestone: ---

Created attachment 51033
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51033&action=edit
Testcase source files

The attached sources files are reduced from a C++ project using boost::asio and
coroutines.

I don't fully understand it but compiling them with vanilla GCC 11.1.0 like
this:
g++ -std=c++2a -fPIC -fcoroutines -Wall -flto -fno-fat-lto-objects -shared
foo.cpp bar.cpp

unexpectedly produces the following diagnostic:
boost.hpp:81:3: warning: type ‘struct
_ZN5boost4asio1gIiFviEE2abIiEENS0_9awaitableIiiEET_.frame’ violates the C++ One
Definition Rule [-Wodr]
   81 |   }
      |   ^
boost.hpp:81:3: note: a different type is defined in another translation unit
   81 |   }
      |   ^
boost.hpp:79:34: note: the first difference of corresponding definitions is
field ‘__D.9984.3.4’
   79 |   template <typename k> static w ab(k ai) {
      |                                  ^
boost.hpp:79:34: note: a field with different name is defined in another
translation unit
   79 |   template <typename k> static w ab(k ai) {
      |

Reply via email to