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

            Bug ID: 104993
           Summary: [modules] Missing diagnostic when exporting
                    using-directive
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: johelegp at gmail dot com
  Target Milestone: ---

[module.interface]p3s1 says
> An exported declaration that is not a module-import-declaration shall declare 
> at least one name.
And its following example includes the line
> `export using namespace N;       // error: does not declare a name`
https://godbolt.org/z/aGY9b6x66 shows Clang give a warning.
> mod.cpp:3:38: warning: ISO C++20 does not permit using directive to be 
> exported [-Wexport-using-directive]
> export namespace y { using namespace x; }
>                                     ^
> 1 warning generated.
GCC is silent: https://godbolt.org/z/zP6648s46.

Source:
```C++
export module mod;
export namespace x { int y; }
export namespace y { using namespace x; }
```

Reply via email to