Issue |
76526
|
Summary |
Clang accepts _export-declaration_ after _linkage-specification_
|
Labels |
clang
|
Assignees |
|
Reporter |
JohelEGP
|
A _linkage-specification_ is a _name-declaration_
and has a terminal `extern` _unevaluated-string_ _name-declaration_.
An _export-declaration_ isn't a _name-declaration_,
but Clang accepts one after a _linkage-specification_.
GCC diagnoses it: <https://compiler-explorer.com/z/nozWPbxbG>.
But Clang accepts it with an unexpected result: <https://compiler-explorer.com/z/eefn3sWMs>.
Note that if the `export` comes before the `extern`, both accept.
GCC: <https://compiler-explorer.com/z/Y3zn6EEKK>.
Clang: <https://compiler-explorer.com/z/zb5qhxYEa>.
```C++
module;
#include <iostream>
export module module_utility;
extern "C" __attribute__ ((visibility ("default")))
export void utility() {
std::cout << "Hello from utility!" << std::endl;
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs