Issue 71347
Summary [C++20][Modules] Cannot export a declaration within a linkage-specification
Labels clang:modules
Assignees
Reporter cpplearner
    Clang rejects the following module unit:

```c++
export module mod;

extern "C++" {
    export void f();
}
```

(https://godbolt.org/z/dPYhGW7ah)

The error message is:

```
<source>:4:5: error: export declaration can only be used within a module purview
    4 |     export void f();
      | ^
```

I think the declaration of `f` should be considered to be within the *purview* of module `mod`, even though it is *attached to* the global module.

Note that GCC and MSVC accept the above module unit.

Also note that clang seems to permit `export extern "C++" { void f(); }`.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to