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
This commit is contained in:
Geoffrey Keating 2007-06-14 21:04:10 +00:00 committed by Geoffrey Keating
parent 7dbd86a541
commit c96f00012b
4 changed files with 16 additions and 1 deletions

View File

@ -1,5 +1,8 @@
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.

View File

@ -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);
}
}

View File

@ -1,5 +1,7 @@
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.

View File

@ -0,0 +1,9 @@
/* 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)
{ }