diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1998-10-14 02:58:38 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1998-10-13 22:58:38 -0400 |
commit | 7f7c930eec6b4eb6a5025fd7f222d4729ef59dea (patch) | |
tree | 146cf6076ebaaf9fd420d97de80a53ce0edb57bc /gcc | |
parent | f69864aab56bd998a4b5cb51332ce0ac779abc66 (diff) | |
download | gcc-7f7c930eec6b4eb6a5025fd7f222d4729ef59dea.zip gcc-7f7c930eec6b4eb6a5025fd7f222d4729ef59dea.tar.gz gcc-7f7c930eec6b4eb6a5025fd7f222d4729ef59dea.tar.bz2 |
* decl.c (grokfndecl): Fix my thinko.
From-SVN: r23077
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/decl.c | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 053fb4b..87e9762 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +1998-10-14 Jason Merrill <jason@yorick.cygnus.com> + + * decl.c (grokfndecl): Fix my thinko. + 1998-10-13 Jason Merrill <jason@yorick.cygnus.com> * tinfo2.cc (fast_compare): Remove. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 91569d0..90b2e53 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); |