aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@apple.com>2007-06-14 21:04:10 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2007-06-14 21:04:10 +0000
commitc96f00012ba9b81dba57042a29361ecd0a99e284 (patch)
treec1e389b5e29af0bf0380ac56b66994756b58febf /gcc
parent7dbd86a54129ec1d59bb967256b368facfea29cd (diff)
downloadgcc-c96f00012ba9b81dba57042a29361ecd0a99e284.zip
gcc-c96f00012ba9b81dba57042a29361ecd0a99e284.tar.gz
gcc-c96f00012ba9b81dba57042a29361ecd0a99e284.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/decl2.c3
-rw-r--r--gcc/testsuite/ChangeLog2
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility/overload-1.C9
4 files changed, 16 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3946630..17cb318 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 4d46410..61decb1 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -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);
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4d7a16a..08bc5ad 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/g++.dg/ext/visibility/overload-1.C b/gcc/testsuite/g++.dg/ext/visibility/overload-1.C
new file mode 100644
index 0000000..d841c53f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/visibility/overload-1.C
@@ -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)
+{ }