toplev.c (check_global_declarations): Don't ask for DECL_ASSEMBLER_NAME unless the function really is declared static...

* toplev.c (check_global_declarations): Don't ask for
	DECL_ASSEMBLER_NAME unless the function really is declared
	static and not defined.

From-SVN: r82611
This commit is contained in:
Geoffrey Keating 2004-06-03 23:16:21 +00:00 committed by Geoffrey Keating
parent 0524c91d1e
commit 3d98fa1402
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2004-06-03 Geoffrey Keating <geoffk@apple.com>
* toplev.c (check_global_declarations): Don't ask for
DECL_ASSEMBLER_NAME unless the function really is declared
static and not defined.
2004-06-03 Matt Austern <austern@apple.com>
PR c++/15428

View File

@ -1516,12 +1516,12 @@ check_global_declarations (tree *vec, int len)
because many programs have static variables
that exist only to get some text into the object file. */
if (TREE_CODE (decl) == FUNCTION_DECL
&& (warn_unused_function
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
&& DECL_INITIAL (decl) == 0
&& DECL_EXTERNAL (decl)
&& ! DECL_ARTIFICIAL (decl)
&& ! TREE_PUBLIC (decl))
&& ! TREE_PUBLIC (decl)
&& (warn_unused_function
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
{
if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
pedwarn ("%J'%F' used but never defined", decl, decl);