[Bug c++/102341] [modules] "error: conflicting exporting declaration" for anything previously declared
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Nov 25 01:45:25 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102341
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathaniel Shead <nshead@gcc.gnu.org>:
https://gcc.gnu.org/g:9dd8be6fc2debc4fbd0950386d4e98878af27a45
commit r14-5838-g9dd8be6fc2debc4fbd0950386d4e98878af27a45
Author: Nathaniel Shead <nathanieloshead@gmail.com>
Date: Mon Nov 13 16:48:36 2023 +1100
c++: Allow exporting a typedef redeclaration [PR102341]
A typedef doesn't create a new entity, and thus should be allowed to be
exported even if it has been previously declared un-exported. See the
example in [module.interface] p6:
export module M;
struct S { int n; };
typedef S S;
export typedef S S; // OK, does not redeclare an entity
PR c++/102341
gcc/cp/ChangeLog:
* decl.cc (duplicate_decls): Allow exporting a redeclaration of
a typedef.
gcc/testsuite/ChangeLog:
* g++.dg/modules/export-1.C: Adjust test.
* g++.dg/modules/export-2_a.C: New test.
* g++.dg/modules/export-2_b.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
More information about the Gcc-bugs
mailing list