diff options
author | Mark Mitchell <mmitchell@usa.net> | 1998-05-20 10:04:25 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1998-05-20 10:04:25 +0000 |
commit | 3568074438b66ec38030db7e1a604158f73fc630 (patch) | |
tree | a65451c103401649edab63a17b403de48f8b42ca /gcc/cp/friend.c | |
parent | 3e98dfd1cb277152daf7d1b2146fb9f0386f75f3 (diff) | |
download | gcc-3568074438b66ec38030db7e1a604158f73fc630.zip gcc-3568074438b66ec38030db7e1a604158f73fc630.tar.gz gcc-3568074438b66ec38030db7e1a604158f73fc630.tar.bz2 |
cp-tree.h (MAIN_NAME_P): New macro.
* cp-tree.h (MAIN_NAME_P): New macro.
(DECL_MAIN_P): Likwise.
* decl.c (pushdecl): Avoid crashing on redefinitions of `main'.
(grokfndecl): Use the new macros.
(grokdeclarator): Likewise.
(start_function): Likewise.
(store_parm_decls): Likewise.
(finsh_function): Likewise.
* friend.c (do_friend): Likewise.
* typeck.c (build_function_call_real): Likewise.
(build_unary_op): Likewise.
From-SVN: r19907
Diffstat (limited to 'gcc/cp/friend.c')
-rw-r--r-- | gcc/cp/friend.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index 52a84a5..6f40f0a 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -364,9 +364,7 @@ do_friend (ctype, declarator, decl, parmdecls, flags, quals, funcdef_flag) } } else if (TREE_CODE (decl) == FUNCTION_DECL - && ((IDENTIFIER_LENGTH (declarator) == 4 - && IDENTIFIER_POINTER (declarator)[0] == 'm' - && ! strcmp (IDENTIFIER_POINTER (declarator), "main")) + && (MAIN_NAME_P (declarator) || (IDENTIFIER_LENGTH (declarator) > 10 && IDENTIFIER_POINTER (declarator)[0] == '_' && IDENTIFIER_POINTER (declarator)[1] == '_' |