+2010-12-30 Nicola Pero <nicola@nicola.brainstorm.co.uk>
+
+ * objc-act.c (start_class): Warn when a class attribute is
+ ignored.
+ (objc_declare_protocols): Warn when a protocol attribute in a
+ protocol forward-declaration is ignored.
+ (start_protocol): Warn when a protocol attribute is ignored.
+
2010-12-30 Nicola Pero <nicola.pero@meta-innovation.com>
* objc-act.c (objc_set_method_opt): Tidy up error messages. In
if (is_attribute_p ("deprecated", name))
TREE_DEPRECATED (klass) = 1;
+ else
+ warning (OPT_Wattributes, "%qE attribute directive ignored", name);
}
TYPE_ATTRIBUTES (klass) = attributes;
}
if (is_attribute_p ("deprecated", name))
deprecated = true;
+ else
+ warning (OPT_Wattributes, "%qE attribute directive ignored", name);
}
}
if (is_attribute_p ("deprecated", name))
deprecated = true;
+ else
+ warning (OPT_Wattributes, "%qE attribute directive ignored", name);
}
}
+2010-12-30 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc.dg/attributes/class-attribute-3.m: New.
+ * objc.dg/attributes/proto-attribute-4.m: New.
+ * obj-c++.dg/attributes/class-attribute-3.mm: New.
+ * obj-c++.dg/attributes/proto-attribute-4.mm: New.
+
2010-12-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/47060
--- /dev/null
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
+/* { dg-do compile } */
+
+/* Test that you get a warning when an unknown class attribute is ignored. */
+
+#include <objc/objc.h>
+
+__attribute__ ((unknown_attribute))
+@interface MyClass /* { dg-warning "ignored" } */
+{
+ Class isa;
+}
++ (id) new;
+@end
--- /dev/null
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
+/* { dg-do compile } */
+
+/* Test that you get a warning when an unknown protocol attribute is ignored. */
+
+#include <objc/objc.h>
+
+__attribute__ ((unknown_attribute))
+@protocol MyProtocol /* { dg-warning "ignored" } */
+- (id) new;
+@end
+
+__attribute__ ((unknown_attribute))
+@protocol MyProtocol2; /* { dg-warning "ignored" } */
+
+/* Use the protocols to double-check that no more warnings are
+ generated. */
+
+@interface MyClass <MyProtocol>
+@end
+
+int test (id <MyProtocol2> x)
+{
+ if (@protocol (MyProtocol) == @protocol (MyProtocol2))
+ return 1;
+
+ if (x)
+ return 2;
+
+ return 3;
+}
--- /dev/null
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
+/* { dg-do compile } */
+
+/* Test that you get a warning when an unknown class attribute is ignored. */
+
+#include <objc/objc.h>
+
+__attribute__ ((unknown_attribute))
+@interface MyClass
+{ /* { dg-warning "ignored" } */
+ Class isa;
+}
++ (id) new;
+@end
--- /dev/null
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
+/* { dg-do compile } */
+
+/* Test that you get a warning when an unknown protocol attribute is ignored. */
+
+#include <objc/objc.h>
+
+__attribute__ ((unknown_attribute))
+@protocol MyProtocol
+- (id) new; /* { dg-warning "ignored" } */
+@end
+
+__attribute__ ((unknown_attribute))
+@protocol MyProtocol2; /* { dg-warning "ignored" } */
+
+/* Use the protocols to double-check that no more warnings are
+ generated. */
+
+@interface MyClass <MyProtocol>
+@end
+
+int test (id <MyProtocol2> x)
+{
+ if (@protocol (MyProtocol) == @protocol (MyProtocol2))
+ return 1;
+
+ if (x)
+ return 2;
+
+ return 3;
+}