[Bug c++/100707] [modules] ICE on nested namespace

amorvincitomnia.iw at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu May 20 16:33:13 GMT 2021


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

--- Comment #1 from wang ivor <amorvincitomnia.iw at gmail dot com> ---
A quick workaround: https://wandbox.org/permlink/n8E5xJuJhq1CUA0e

Create a module that only contains the namespace declaration, and 'export
import' it whenever you declare a new namespace.

// namespace_decl.cc

export module namespace_decl;

export namespace A::B{
}

// m2.cc

export module m2;

export import namespace_decl;

import m3;
export namespace A::B{
}


More information about the Gcc-bugs mailing list