================ @@ -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; +} ---------------- a-tarasyuk wrote:
@Sirraide Thanks for the feedback. I've moved directly to `CheckMain` 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