decl2.c (is_late_template_attribute): Don't defer attribute visibility just because...
authorJason Merrill <jason@redhat.com>
Fri, 25 Jan 2008 19:47:28 +0000 (14:47 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 25 Jan 2008 19:47:28 +0000 (14:47 -0500)
        * decl2.c (is_late_template_attribute): Don't defer attribute
        visibility just because the type is dependent.

From-SVN: r131833

gcc/cp/ChangeLog
gcc/cp/decl2.c

index 9383ccd95e662c1c395bd2b884851bcda5bca788..22afe1941f408d79373e031827446aaa45d7e3a4 100644 (file)
@@ -1,3 +1,8 @@
+2008-01-25  Jason Merrill  <jason@redhat.com>
+
+       * decl2.c (is_late_template_attribute): Don't defer attribute
+       visibility just because the type is dependent.
+
 2008-01-25  Jason Merrill  <jason@redhat.com>
            Mark Mitchell  <mark@codesourcery.com>
 
index 550d0bcebab7f275eea2d4a6577a074b92dab060..fa8d28a2542645295a7a96f9d16a69457240bab9 100644 (file)
@@ -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;