From 94706a5cfc9f995e52279c7594d188d826156f19 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 16 Oct 1998 03:20:33 +0000 Subject: [PATCH] * decl.c (grokfndecl): Also check ctype when checking for ::main(). From-SVN: r23123 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/decl.c | 1 + 2 files changed, 5 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0958c3b7ca0..2a830ee0475 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +1998-10-16 Jason Merrill + + * decl.c (grokfndecl): Also check ctype when checking for ::main(). + 1998-10-15 Jason Merrill * decl.c (grokfndecl): ::main and __builtin_* get C linkage. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 29605a73b73..75a37a651d4 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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; -- 2.30.2