https://github.com/MitalAshok requested changes to this pull request.
You can put some of the tests in `clang/test/CXX/basic/basic.start/basic.start.main/p3.cpp` You lost the check for `extern "C++" int main() {}` at global scope. To recap: ```c++ // These are disallowed by [basic.start.main]p3 // The main function shall not be declared with a linkage-specification. // We only want a pedantic warning for these extern "C++" { int main(); } extern "C" { int main(); } // These are disallowed by [basic.start.main]p(3.4) // We want a hard error namespace X { extern "C" int main; } extern "C" { namespace Y { int main; } namespace Z { void main(); } } // These are allowed namespace W { extern "C++" int main(); extern "C" { extern "C++" { int main(void*); } } } ``` (You should add a test for `extern "C" { namespace namespace_name { int main; } }` too) Did you try doing it like https://github.com/llvm/llvm-project/issues/101512#issuecomment-2263650171 , checking `Decl->getLanguageLinkage()` rather than checking the DeclContext it's declared in? https://github.com/llvm/llvm-project/pull/101853 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits