diff options
author | Jason Merrill <jason@redhat.com> | 2013-05-20 13:37:44 +0000 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2013-05-20 13:37:44 +0000 |
commit | 51d5d05b1fd00bd1b710ce51b3da65fb9e61220a (patch) | |
tree | 658826d2f8c0b79c0a970c603048622f4f835c4f /gcc/cp | |
parent | 73e72c93f2caf345b10dbf70b4ae889ab665e0d9 (diff) |
PR c++/57317
* decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
whether a template has its own args.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@199104 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d641b9f19b1..87ae7ac6ba7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2013-05-20 Jason Merrill <jason@redhat.com> + + PR c++/57317 + * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide + whether a template has its own args. + 2013-05-16 Jason Merrill <jason@redhat.com> PR c++/57279 diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index b91408af9ca..628be934bff 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2213,9 +2213,6 @@ determine_visibility (tree decl) && !lookup_attribute ("visibility", attribs)) { int depth = TMPL_ARGS_DEPTH (args); - int class_depth = 0; - if (class_type && CLASSTYPE_TEMPLATE_INFO (class_type)) - class_depth = TMPL_ARGS_DEPTH (CLASSTYPE_TI_ARGS (class_type)); if (DECL_VISIBILITY_SPECIFIED (decl)) { /* A class template member with explicit visibility @@ -2228,7 +2225,7 @@ determine_visibility (tree decl) constrain_visibility_for_template (decl, lev); } } - else if (depth > class_depth) + else if (PRIMARY_TEMPLATE_P (TI_TEMPLATE (tinfo))) /* Limit visibility based on its template arguments. */ constrain_visibility_for_template (decl, args); } |