Objective-C/C++ : Allow visibility prefix attributes on interfaces.
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 25 Oct 2020 17:34:29 +0000 (17:34 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Fri, 6 Nov 2020 19:55:25 +0000 (19:55 +0000)
This passes visibiliy through without warning (so that, for example,
__attribute__((__visibility("default"))) does not result in any
diagnostic).

gcc/objc/ChangeLog:

* objc-act.c (start_class): Accept visibility attributes
without warning.

gcc/objc/objc-act.c

index 26cdeddfc5af63bf961618b6a5abcd0ae036c0a9..68d829fd773d8bca4e0962acc61c6f965e1c5604 100644 (file)
@@ -7013,12 +7013,14 @@ start_class (enum tree_code code, tree class_name, tree super_name,
              tree name = TREE_PURPOSE (attribute);
 
              /* TODO: Document what the objc_exception attribute is/does.  */
-             /* We handle the 'deprecated' and (undocumented) 'objc_exception'
-                attributes.  */
+             /* We handle the 'deprecated', 'visibility' and (undocumented)
+                'objc_exception' attributes.  */
              if (is_attribute_p  ("deprecated", name))
                TREE_DEPRECATED (klass) = 1;
              else if (is_attribute_p  ("objc_exception", name))
                CLASS_HAS_EXCEPTION_ATTR (klass) = 1;
+             else if (is_attribute_p  ("visibility", name))
+               ;
              else
                /* Warn about and ignore all others for now, but store them.  */
                warning (OPT_Wattributes, "%qE attribute directive ignored", name);