This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118f. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-11-07
(From submission #752.)
Consider:
int main() noexcept {}
Prior to P0012R1 (C++17), this was allowed, because noexcept was not part of a function type. This is now ill-formed, because such a main function is not of one of the types allowed in 6.10.3.1 [basic.start.main] paragraph 2.
This needs an Annex C entry or a relaxation of the rules. Note that the presence or absence of noexcept does not change behavior, because an exception leaving main calls std::terminate either way, and main cannot be named in expressions.
Proposed resolution (approved by CWG 2025-11-05):
Change in 6.10.3.1 [basic.start.main] paragraph 2 as follows:
... An implementation shall allow bothas the type of main (9.3.4.6 [dcl.fct]). ...
- an "optionally noexcept function of () returning int" and
- an "optionally noexcept function of (int, pointer to pointer to char) returning int"