https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124485
Bug ID: 124485
Summary: [modules] Conflicting declaration 'struct
__cxxabiv1::__class_type_info'
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: d7d1cd at mail dot ru
Target Milestone: ---
Here's the module code:
$ cat foo.ixx
module;
#include <cxxabi.h>
#include <string>
#include <atomic>
export module foo;
export class Foo { std::atomic<int> a; };
And here's the code that uses this module:
$ cat main.cc
import foo;
struct Type { virtual ~Type() {} };
int main() {}
When compiling these sources, an error occurs:
$ g++ -std=c++26 -fmodules foo.ixx main.cc
main.cc:3:13: error: conflicting declaration ‘struct
__cxxabiv1::__class_type_info’
3 | int main() {}
| ^
In file included from foo.ixx:2,
of module foo, imported at main.cc:1:
/usr/local/gcc-trunk/include/c++/16/cxxabi.h:412:9: note: previous
declaration as ‘class __cxxabiv1::__class_type_info’
412 | class __class_type_info : public std::type_info
| ^~~~~~~~~~~~~~~~~
main.cc:3: confused by earlier
If I specify standard 23 or compile with compiler version 15.2, there is no
compilation error.
Here's a reproduction on godbolt: https://godbolt.org/z/z4395qYdG