From 7f7c930eec6b4eb6a5025fd7f222d4729ef59dea Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 14 Oct 1998 02:58:38 +0000 Subject: [PATCH] * decl.c (grokfndecl): Fix my thinko. From-SVN: r23077 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/decl.c | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 053fb4b6ae6..87e97623267 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +1998-10-14 Jason Merrill + + * decl.c (grokfndecl): Fix my thinko. + 1998-10-13 Jason Merrill * tinfo2.cc (fast_compare): Remove. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 91569d07b27..90b2e53d5be 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8024,9 +8024,14 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals, t = no_linkage_check (TREE_TYPE (decl)); if (t) { - if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)) - && DECL_LANGUAGE (decl) != lang_c) - cp_pedwarn ("non-local function `%#D' uses anonymous type", decl); + if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))) + { + if (DECL_LANGUAGE (decl) == lang_c) + /* Allow this; it's pretty common in C. */; + else + cp_pedwarn ("non-local function `%#D' uses anonymous type", + decl); + } else cp_pedwarn ("non-local function `%#D' uses local type `%T'", decl, t); -- 2.30.2