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
This commit is contained in:
Tom Tromey 2007-11-08 19:50:38 +00:00
parent 061c5ee427
commit c02cdc25dc
4 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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>
* class.c (build_ctor_vtbl_group): Lay out the new type and decl.

View File

@ -2493,6 +2493,10 @@ decl_linkage (tree decl)
if (!DECL_NAME (decl))
return lk_none;
/* Fields have no linkage. */
if (TREE_CODE (decl) == FIELD_DECL)
return lk_none;
/* Things that are TREE_PUBLIC have external linkage. */
if (TREE_PUBLIC (decl))
return lk_external;

View File

@ -1,3 +1,8 @@
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>
* gcc.dg/compat/struct-layout-1_generate.c (dg-options) Add

View File

@ -0,0 +1,11 @@
// Regression test for ICE from PR c++/30297.
struct A
{
int i;
};
extern "C" struct B : A
{
A::i;
};