1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
2 // RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class %s
4 __attribute__((objc_subclassing_restricted))
5 @interface Leaf // okay
8 __attribute__((objc_subclassing_restricted))
9 @interface SubClassOfLeaf : Leaf // expected-note {{class is declared here}}
13 @interface SubClass : SubClassOfLeaf // expected-error {{cannot subclass a class that was declared with the 'objc_subclassing_restricted' attribute}}
16 __attribute__((objc_root_class))
20 __attribute__((objc_subclassing_restricted))
21 @interface Sub2Class : PlainRoot // okay
24 __attribute__((objc_subclassing_restricted))
25 @interface SuperImplClass // expected-note {{class is declared here}}
27 @implementation SuperImplClass
30 __attribute__((objc_subclassing_restricted))
31 @interface SubImplClass : SuperImplClass
33 @implementation SubImplClass // expected-error {{cannot subclass a class that was declared with the 'objc_subclassing_restricted' attribute}}