Ben already indicated that the draft C++ standard in section 3.6.1
Main function says:
The function main shall not be used within a program. [...]
but the term used is not defined and so it is not clear what the interpretation should be. Fortunately for us, we can find two pieces of evidence outside of SO that strongly indicates any use at all of main
is ill-formed.
First we have this discussion in the undefined behaviour study group discussion list in the thread What does "The function main shall not be used within a program" mean?, this quote from here seems to sum up the sentiment:
C++98's mention of 'use' had a cross-reference to 3.2 [basic.def.odr].
C++11 no longer has the cross-reference, and was not changed to say
'odr-use', so I expect it means any use.
we have further evidence from original proposal: N3154 to fix Defect report 1109 would have changed 3.6.1
to:
The function main shall not be odr-used (3.2) within a program. ...
but was amended when accepted and we can see that the new proposal: N3214 changed to what we have today:
The function main shall not be used within a program
main
than for any other function. – Tinselmain
a friend as such, is the reasons behind it that are usually the problem. – Katzmain
shall not be used within a program"). Consequently, any arguments that support the claimmain
shall not be used anywhere else in the program are welcome. – Publias