Description
#101853 introduces a couple of problems. I guess, this boils down to marking the declaration of main() invalid in case it's declared with extern "C", but I may be wrong here.
The first problem is a clang crash: https://gcc.godbolt.org/z/dWETErhzM
The second one is a change of behavior of code that declares main() extern "C" (see my comment 37ec6e5#r145380228). This one still needs some work to create a standalone repro for, but I suspect that both issues are related to marking the declaration invalid.
The problem with both cases is that in some codebases the non-trivial amount of cleanup is necessary for this, but Clang doesn't allow to postpone the cleanup and retain the old behavior by just ignoring the diagnostic (-Wno-main). Even if the diagnostic is not issued, the issues above still manifest.