aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc/objc-act.c
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2020-10-25 17:34:29 +0000
committerIain Sandoe <iain@sandoe.co.uk>2020-11-06 19:55:25 +0000
commit6e8e1036f79e575fbe1eda57957158291c12f195 (patch)
treeefde6cebe0d6418077b99b3279204ec932cea116 /gcc/objc/objc-act.c
parent9a34a5cce6b50fc3527e7c7ab356808ed435883c (diff)
downloadgcc-6e8e1036f79e575fbe1eda57957158291c12f195.zip
gcc-6e8e1036f79e575fbe1eda57957158291c12f195.tar.gz
gcc-6e8e1036f79e575fbe1eda57957158291c12f195.tar.bz2
Objective-C/C++ : Allow visibility prefix attributes on interfaces.
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.
Diffstat (limited to 'gcc/objc/objc-act.c')
-rw-r--r--gcc/objc/objc-act.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 26cdedd..68d829f 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -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);