$3.6.1/3 states-
"The function main shall not be used (3.2) within a program.".
The sample academically motivated program below uses the name 'main' in a couple of ways which I thought are legitimate. This is based on the assumption that 'usage of a function' is related to calling the function (directly/indirectly).
struct MyClass{
private:
MyClass(){}
friend int main();
};
int main(){
MyClass m;
int (*p)() = main; // but don't do anything
}
Fair enough, the code shown compiles with gcc/VS 2010.
I am surprised by Comeau's error.
Comeau online gives error while declaration 'p' (i.e while taking address of 'main') but not while declaraing 'main' as a friend.
Who/What is right with respect to C++03?