-
Notifications
You must be signed in to change notification settings - Fork 15k
Closed
Labels
c++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
This currently just seems to be ignored (the name is not mangled).
It is explicitly disallowed by https://eel.is/c++draft/basic.start.main#3.sentence-5
The
main
function shall not be declared with a linkage-specification.
This includes
extern "C++" { int main(); }
This is also technically ill-formed
extern "C" int main();
but it seems to be used in some places:
extern "C" int main(int argc, char **argv, char **envp); |
extern "C" int main(int argc, char **argv, char **envp); |
So this should probably just be a warning, not an error.
frederick-vs-ja and a-tarasyuk
Metadata
Metadata
Assignees
Labels
c++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute