This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-09-28
(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.
Suggested resolution:
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]). ...
- a "optionally noexcept function of () returning int" and
- a "optionally noexcept function of (int, pointer to pointer to char) returning int"