* decl2.c (determine_visibility): Ensure that functions with
hidden types as parameters are hidden.
From-SVN: r125722
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.
{
/* 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.
--- /dev/null
+/* 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)
+{ }