Commit eb2182e2 by Mark Mitchell Committed by Mark Mitchell

re PR c++/24302 (anonymous global union segfault with g++ 3.4.x)

	PR c++/24302
	* toplev.c (check_global_declaration_1): Robustify.
	PR c++/24302
	* g++.dg/warn/Wunused-12.C: New test.

From-SVN: r105222
parent 18c75543
2005-10-10 Mark Mitchell <mark@codesourcery.com>
PR c++/24277
* pt.c (instantiate_decl): Call finish_static_data_member_decl for
static data members.
2005-10-10 Giovanni Bajo <giovannibajo@gcc.gnu.org>
Mark Mitchell <mark@codesourcery.com>
......
2005-10-10 Mark Mitchell <mark@codesourcery.com>
PR c++/24302
* g++.dg/warn/Wunused-12.C: New test.
PR c++/23437
* g++.dg/template/arg4.C: New test.
// PR c++/24302
// { dg-options "-Wunused" }
static union
{
unsigned char FLT4ARR[4];
float FLT4;
}; // { dg-warning "used" }
......@@ -836,7 +836,7 @@ check_global_declaration_1 (tree decl)
&& ! TREE_USED (decl)
/* The TREE_USED bit for file-scope decls is kept in the identifier,
to handle multiple external decls in different scopes. */
&& ! TREE_USED (DECL_NAME (decl))
&& ! (DECL_NAME (decl) && TREE_USED (DECL_NAME (decl)))
&& ! DECL_EXTERNAL (decl)
&& ! TREE_PUBLIC (decl)
/* A volatile variable might be used in some non-obvious way. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment