Commit c02cdc25 by Tom Tromey

re PR c++/30297 (ICE with extern "C" and inheritance)

gcc/cp
2007-11-08  Andrew Pinski  <pinskia@gmail.com>
	PR c++/30297:
	* tree.c (decl_linkage): Fields have no linkage.
gcc/testsuite
	PR c++/30297:
	* g++.dg/inherit/pr30297.C: New file.

From-SVN: r130018
parent 061c5ee4
2007-11-08 Andrew Pinski <pinskia@gmail.com>
PR c++/30297:
* tree.c (decl_linkage): Fields have no linkage.
2007-11-08 Daniel Jacobowitz <dan@codesourcery.com> 2007-11-08 Daniel Jacobowitz <dan@codesourcery.com>
* class.c (build_ctor_vtbl_group): Lay out the new type and decl. * class.c (build_ctor_vtbl_group): Lay out the new type and decl.
......
...@@ -2493,6 +2493,10 @@ decl_linkage (tree decl) ...@@ -2493,6 +2493,10 @@ decl_linkage (tree decl)
if (!DECL_NAME (decl)) if (!DECL_NAME (decl))
return lk_none; return lk_none;
/* Fields have no linkage. */
if (TREE_CODE (decl) == FIELD_DECL)
return lk_none;
/* Things that are TREE_PUBLIC have external linkage. */ /* Things that are TREE_PUBLIC have external linkage. */
if (TREE_PUBLIC (decl)) if (TREE_PUBLIC (decl))
return lk_external; return lk_external;
......
2007-11-08 Tom Tromey <tromey@redhat.com>
PR c++/30297:
* g++.dg/inherit/pr30297.C: New file.
2007-11-08 Danny Smith <dannysmith@users.sourceforge.net> 2007-11-08 Danny Smith <dannysmith@users.sourceforge.net>
* gcc.dg/compat/struct-layout-1_generate.c (dg-options) Add * gcc.dg/compat/struct-layout-1_generate.c (dg-options) Add
// Regression test for ICE from PR c++/30297.
struct A
{
int i;
};
extern "C" struct B : A
{
A::i;
};
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