================ @@ -12370,6 +12379,17 @@ void Sema::CheckMain(FunctionDecl* FD, const DeclSpec& DS) { } } +bool Sema::CheckLinkageSpecification(DeclContext *DC, Decl *D) { + // [basic.start.main] p2 + // The main function shall not be declared with a linkage-specification. + if (DC->isExternCContext()) { + Diag(D->getLocation(), diag::err_main_invalid_linkage_specification); + D->setInvalidDecl(); + return true; + } + return false; +} ---------------- MitalAshok wrote:
Does this need a separate member function? It seems like this would be good as a static helper function 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