Commit c96f0001 by Geoffrey Keating Committed by Geoffrey Keating

decl2.c (determine_visibility): Ensure that functions with hidden types as parameters are hidden.

	* decl2.c (determine_visibility): Ensure that functions with
	hidden types as parameters are hidden.

From-SVN: r125722
parent 7dbd86a5
2007-06-14 Geoff Keating <geoffk@apple.com>
* decl2.c (determine_visibility): Ensure that functions with
hidden types as parameters are hidden.
PR 31093
* decl2.c (determine_visibility): Remove duplicate code for
handling type info.
......
......@@ -1783,7 +1783,8 @@ determine_visibility (tree decl)
{
/* Propagate anonymity from type to decl. */
int tvis = type_visibility (TREE_TYPE (decl));
if (tvis == VISIBILITY_ANON)
if (tvis == VISIBILITY_ANON
|| ! DECL_VISIBILITY_SPECIFIED (decl))
constrain_visibility (decl, tvis);
}
}
......
2007-06-14 Geoff Keating <geoffk@apple.com>
* g++.dg/ext/visibility/overload-1.C: New.
PR 31093
* g++.dg/ext/visibility/anon4.C: New.
/* Test that visibility of function parameters propagates to an undecorated
function. */
/* { dg-require-visibility "" }
/* { dg-final { scan-hidden "_Z3fooP8a_struct" } } */
struct __attribute__((visibility("hidden"))) a_struct;
void foo(a_struct * p)
{ }
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