diff options
author | Jason Merrill <jason@redhat.com> | 2011-11-06 23:40:14 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-11-06 23:40:14 -0500 |
commit | 8e7860a17b0c38d5fae79b39f61e2d74a9be65eb (patch) | |
tree | 331d493a855e94c131a78809a6e5e3cd9da0986e /gcc/cp/decl2.c | |
parent | c0baa6dc73fe81da219a5e8a1b6f83702f7ef879 (diff) | |
download | gcc-8e7860a17b0c38d5fae79b39f61e2d74a9be65eb.zip gcc-8e7860a17b0c38d5fae79b39f61e2d74a9be65eb.tar.gz gcc-8e7860a17b0c38d5fae79b39f61e2d74a9be65eb.tar.bz2 |
re PR c++/35688 (template visibility not overridden by template arguments)
PR c++/35688
gcc/c-common/
* c-common.c (decl_has_visibility_attr): Split out from...
(c_determine_visibility): ...here.
* c-common.h: Declare it.
gcc/cp/
* decl2.c (constrain_visibility): Check decl_has_visibility_attr
rather than DECL_VISIBILITY_SPECIFIED.
From-SVN: r181069
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index f4499b5..80fb0c3 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1974,8 +1974,11 @@ constrain_visibility (tree decl, int visibility) DECL_NOT_REALLY_EXTERN (decl) = 1; } } + /* We check decl_has_visibility_attr rather than + DECL_VISIBILITY_SPECIFIED here because we want other considerations + to override visibility from a namespace or #pragma. */ else if (visibility > DECL_VISIBILITY (decl) - && !DECL_VISIBILITY_SPECIFIED (decl)) + && !decl_has_visibility_attr (decl)) { DECL_VISIBILITY (decl) = (enum symbol_visibility) visibility; return true; |