Commit cfea9968 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/47303 (ICE: in varpool_node, at varpool.c:134 with -fabi-version=1)

	PR c++/47303
	* decl2.c (finish_anon_union): Only call mangle_decl if TREE_STATIC
	or DECL_EXTERNAL.

	* g++.dg/template/anonunion1.C: New test.

From-SVN: r169000
parent b899fd78
2011-01-19 Jakub Jelinek <jakub@redhat.com>
PR c++/47303
* decl2.c (finish_anon_union): Only call mangle_decl if TREE_STATIC
or DECL_EXTERNAL.
2011-01-17 Jason Merrill <jason@redhat.com> 2011-01-17 Jason Merrill <jason@redhat.com>
PR c++/47067 PR c++/47067
......
...@@ -1409,6 +1409,7 @@ finish_anon_union (tree anon_union_decl) ...@@ -1409,6 +1409,7 @@ finish_anon_union (tree anon_union_decl)
/* Use main_decl to set the mangled name. */ /* Use main_decl to set the mangled name. */
DECL_NAME (anon_union_decl) = DECL_NAME (main_decl); DECL_NAME (anon_union_decl) = DECL_NAME (main_decl);
maybe_commonize_var (anon_union_decl); maybe_commonize_var (anon_union_decl);
if (TREE_STATIC (anon_union_decl) || DECL_EXTERNAL (anon_union_decl))
mangle_decl (anon_union_decl); mangle_decl (anon_union_decl);
DECL_NAME (anon_union_decl) = NULL_TREE; DECL_NAME (anon_union_decl) = NULL_TREE;
} }
......
/* Handle parameterized types (templates) for GNU C++. /* Handle parameterized types (templates) for GNU C++.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc. Free Software Foundation, Inc.
Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing. Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing.
Rewritten by Jason Merrill (jason@cygnus.com). Rewritten by Jason Merrill (jason@cygnus.com).
......
2011-01-19 Jakub Jelinek <jakub@redhat.com> 2011-01-19 Jakub Jelinek <jakub@redhat.com>
PR c++/47303
* g++.dg/template/anonunion1.C: New test.
PR rtl-optimization/47337 PR rtl-optimization/47337
* gcc.c-torture/execute/pr47337.c: New test. * gcc.c-torture/execute/pr47337.c: New test.
......
// PR c++/47303
// { dg-do compile }
// { dg-options "-fabi-version=1" }
struct Z
{
void foo (int);
};
struct F
{
typedef void (Z::*zm) (int);
typedef void (F::*fm) (int);
template <zm>
void bar (int)
{
union
{
Z z;
};
}
};
F::fm m = &F::bar <&Z::foo>;
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