From d54b962041ed399305f12f6db7de0c5186db96d4 Mon Sep 17 00:00:00 2001 From: jason Date: Fri, 25 Jan 2008 19:47:28 +0000 Subject: [PATCH 1/1] * decl2.c (is_late_template_attribute): Don't defer attribute visibility just because the type is dependent. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131833 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/decl2.c | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9383ccd95e6..22afe1941f4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,4 +1,9 @@ 2008-01-25 Jason Merrill + + * decl2.c (is_late_template_attribute): Don't defer attribute + visibility just because the type is dependent. + +2008-01-25 Jason Merrill Mark Mitchell PR c++/31780 diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 550d0bcebab..fa8d28a2542 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1014,9 +1014,12 @@ is_late_template_attribute (tree attr, tree decl) || code == BOUND_TEMPLATE_TEMPLATE_PARM || code == TYPENAME_TYPE) return true; - /* Also defer attributes on dependent types. This is not necessary - in all cases, but is the better default. */ - else if (dependent_type_p (type)) + /* Also defer most attributes on dependent types. This is not + necessary in all cases, but is the better default. */ + else if (dependent_type_p (type) + /* But attribute visibility specifically works on + templates. */ + && !is_attribute_p ("visibility", name)) return true; else return false; -- 2.11.0