* decl.c (grokfndecl): Also check ctype when checking for ::main().
authorJason Merrill <jason@yorick.cygnus.com>
Fri, 16 Oct 1998 03:20:33 +0000 (03:20 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 16 Oct 1998 03:20:33 +0000 (23:20 -0400)
From-SVN: r23123

gcc/cp/ChangeLog
gcc/cp/decl.c

index 0958c3b7ca0d70a146d30c5348893aacffac7f71..2a830ee0475aec4003500346428466f7aed23b97 100644 (file)
@@ -1,3 +1,7 @@
+1998-10-16  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * decl.c (grokfndecl): Also check ctype when checking for ::main().
+
 1998-10-15  Jason Merrill  <jason@yorick.cygnus.com>
 
        * decl.c (grokfndecl): ::main and __builtin_* get C linkage.
index 29605a73b7306fa35766fe126d6284cbdacf5ade..75a37a651d494f712a7a882476b523f7deaf35f4 100644 (file)
@@ -8026,6 +8026,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
       /* context == 0 could mean global scope or not set yet; either is fine
         for us here, as we check current_namespace.  */
       && DECL_CONTEXT (decl) == NULL_TREE
+      && ctype == NULL_TREE
       && current_namespace == global_namespace)
     DECL_LANGUAGE (decl) = lang_c;