Created on 2025-08-15.00:00:00 last changed yesterday
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"
(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.
History | |||
---|---|---|---|
Date | User | Action | Args |
2025-09-12 22:42:26 | admin | set | messages: + msg8091 |
2025-08-15 00:00:00 | admin | create |