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

            Bug ID: 124582
           Summary: Conflicting imported declaration with both modules and
                    reflection enabled
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nick.weihs at gmail dot com
  Target Milestone: ---

Using the snapshot build from Saturday of this week, I'm getting the following
error while compiling a project that uses both reflection and modules.  I'm not
entirely sure if the problem is in gcc or cmake but I figure this is a good
place to start.

In file included from /usr/include/pthread.h:26,
                 from
/usr/include/c++/16.0.0/x86_64-pc-linux-gnu/bits/gthr-default.h:35,
                 from
/usr/include/c++/16.0.0/x86_64-pc-linux-gnu/bits/gthr.h:157,
                 from /usr/include/c++/16.0.0/bits/atomic_wait.h:40,
                 from /usr/include/c++/16.0.0/bits/atomic_base.h:43,
                 from /usr/include/c++/16.0.0/atomic:53,
                 from Types.ixx:3,
of module YT:Types, imported at BlockTable.ixx:11:
/usr/include/bits/pthreadtypes.h:72:3: error: conflicting imported declaration
‘typedef union pthread_mutex_t pthread_mutex_t’ [-Wtemplate-body]
   72 | } pthread_mutex_t;
      |   ^~~~~~~~~~~~~~~
In file included from /usr/include/pthread.h:26,
                 from
/usr/include/c++/16.0.0/x86_64-pc-linux-gnu/bits/gthr-default.h:35,
                 from
/usr/include/c++/16.0.0/x86_64-pc-linux-gnu/bits/gthr.h:157,
                 from /usr/include/c++/16.0.0/bits/atomic_wait.h:40,
                 from /usr/include/c++/16.0.0/bits/atomic_base.h:43,
                 from /usr/include/c++/16.0.0/atomic:53,
                 from BlockTable.ixx:3:
/usr/include/bits/pthreadtypes.h:72:3: note: existing declaration ‘typedef
union pthread_mutex_t pthread_mutex_t’
   72 | } pthread_mutex_t;
      |   ^~~~~~~~~~~~~~~
BlockTable.ixx:622:9: note: during load of binding ‘YT::Mutex@YT:Types’
  622 |         Mutex m_BlockAllocMutex;

Somehow it's telling me that there's conflicting symbols, however the two
symbols it's telling me are conflicted are exactly the same.  This only happens
if I enable -freflection.  Without that flag it compiles fine

I've uploaded a trimmed down version of the problem along with a simple build
script here:
https://github.com/hamfirst/gccbug

Reply via email to