This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/66606] missing diagnostic on using function main


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66606

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
One other observation (and actually the reason why I found this problem) is
that the diagnostic GCC issues for the call to main in bar:

int bar () { return main (); }

is misleading.  The operand of the return statement is a call to main, not an
ADDR_EXPR.  (It just happens to be easy to handle both in cp_build_addr_expr_1
because it doesn't distinguish between the two.)  The Clang diagnostic doesn't
suffer from the same problem (and so can be used in all other contexts.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]