Commit 532b37d9 by Mark Mitchell Committed by Mark Mitchell

re PR target/18925 (Invalid gprel relocation in PIC)

	PR c++/18925
	* class.c (layout_class_type): Determine the visibility of static
	data members.

	PR c++/18925
	* g++.dg/ext/visibility/staticdatamem.C: New test.

From-SVN: r92120
parent fd2ad93d
2004-12-13 Mark Mitchell <mark@codesourcery.com>
PR c++/18925
* class.c (layout_class_type): Determine the visibility of static
data members.
2004-12-12 Roger Sayle <roger@eyesopen.com>
PR middle-end/12454
......
......@@ -4553,7 +4553,13 @@ layout_class_type (tree t, tree *virtuals_p)
At this point, finish_record_layout will be called, but
S1 is still incomplete.) */
if (TREE_CODE (field) == VAR_DECL)
maybe_register_incomplete_var (field);
{
maybe_register_incomplete_var (field);
/* The visibility of static data members is determined
at their point of declaration, not their point of
definition. */
determine_visibility (field);
}
continue;
}
......
2004-12-13 Mark Mitchell <mark@codesourcery.com>
PR c++/18925
* g++.dg/ext/visibility/staticdatamem.C: New test.
2004-12-13 Kelley Cook <kcook@gcc.gnu.org>
* gcc.target/xstormy16/below100.S: Remove DOS line endings.
......
// PR c++/18925
// { dg-do compile { target ia64-*-linux* } }
// { dg-options "-fPIC -fvisibility=hidden" }
// { dg-final { scan-assembler-not "gprel" } }
class __attribute__ ((visibility("default"))) Type
{
private:
static long _staticTypeCount;
public:
Type() { _staticTypeCount++; }
~Type();
};
long Type::_staticTypeCount = 0;
Type::~Type()
{
_staticTypeCount--;
}
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