Stephen Prata in his book C++ Primer Plus [p 31] says :
Many existing programs use the classic C function header instead:
main() // original C style
Under classic C, omitting the return type is the same as saying that the function is type int. However, C++ has phased out that usage.
However The C++11 draft 3.6.1->2 says
An implementation shall not predefine the main function. This function shall not be overloaded. It shall have a return type of type int, but otherwise its type is implementation-defined.
Test Result
$ g++ -Werror=pedantic MainCheck.cpp -o MainCheck
MainCheck.cpp:3:6: error: ISO C++ forbids declaration of ‘main’ with no type [-Werror=pedantic]
main()
$ # also means g++ don't conform to the standard
confirms that what Mr. Prata said is true when it comes to C++ standard.
Is there a clause in the C++11 draft that discourages the use of :
main() // that is without return type.
Is
It shall have a return type of type int
itself such a clause?