// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class %s
// rdar://16560476
__attribute__((objc_subclassing_restricted))@interfaceLeaf// okay
@end__attribute__((objc_subclassing_restricted))@interfaceSubClassOfLeaf:Leaf// expected-note {{class is declared here}}
@end@interfaceSubClass:SubClassOfLeaf// expected-error {{cannot subclass a class that was declared with the 'objc_subclassing_restricted' attribute}}
@end__attribute__((objc_root_class))@interfacePlainRoot@end__attribute__((objc_subclassing_restricted))@interfaceSub2Class:PlainRoot// okay
@end// rdar://28753587
__attribute__((objc_subclassing_restricted))@interfaceSuperImplClass// expected-note {{class is declared here}}
@end@implementationSuperImplClass@end__attribute__((objc_subclassing_restricted))@interfaceSubImplClass:SuperImplClass@end@implementationSubImplClass// expected-error {{cannot subclass a class that was declared with the 'objc_subclassing_restricted' attribute}}
@end