https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120773
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:ed7fc2b29ead88be30b40ec2c3c51495200b08c4 commit r16-1657-ged7fc2b29ead88be30b40ec2c3c51495200b08c4 Author: Jakub Jelinek <ja...@redhat.com> Date: Tue Jun 24 19:00:11 2025 +0200 c++: Implement C++26 P3618R0 - Allow attaching main to the global module [PR120773] The following patch implements the P3618R0 paper by tweaking pedwarn condition, adjusting pedwarn wording, adjusting one testcase and adding 4 new ones. The paper was voted in as DR, so it isn't guarded on C++ version. 2025-06-24 Jakub Jelinek <ja...@redhat.com> PR c++/120773 * decl.cc (grokfndecl): Implement C++26 P3618R0 - Allow attaching main to the global module. Only pedwarn for current_lang_name other than lang_name_cplusplus and adjust pedwarn wording. * g++.dg/parse/linkage5.C: Don't expect error on extern "C++" int main ();. * g++.dg/parse/linkage7.C: New test. * g++.dg/parse/linkage8.C: New test. * g++.dg/modules/main-2.C: New test. * g++.dg/modules/main-3.C: New test.