The following code snippet is wrongly rejected int main() { sizeof(&main); }
--- main.cpp: In function 'int main()': main.cpp:1: warning: ISO C++ forbids taking address of function '::main' --- But the Standard allows that within a sizeof, because according to 3.2/2 it does not constitute a "use" of main. -- Summary: &main should be allowed within unevaluated operands. Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: schaub-johannes at web dot de GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41431