brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 9ada8c2 Raw
35 lines · plain
1// RUN: %clang_cc1  -fsyntax-only -verify -Wno-objc-root-class %s2// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class %s3 4__attribute__((objc_subclassing_restricted))5@interface Leaf // okay6@end7 8__attribute__((objc_subclassing_restricted))9@interface SubClassOfLeaf : Leaf // expected-note {{class is declared here}}10@end11 12 13@interface SubClass : SubClassOfLeaf // expected-error {{cannot subclass a class that was declared with the 'objc_subclassing_restricted' attribute}}14@end15 16__attribute__((objc_root_class))17@interface PlainRoot18@end19 20__attribute__((objc_subclassing_restricted))21@interface Sub2Class : PlainRoot // okay22@end23 24__attribute__((objc_subclassing_restricted))25@interface SuperImplClass // expected-note {{class is declared here}}26@end27@implementation SuperImplClass28@end29 30__attribute__((objc_subclassing_restricted))31@interface SubImplClass : SuperImplClass32@end33@implementation SubImplClass // expected-error {{cannot subclass a class that was declared with the 'objc_subclassing_restricted' attribute}}34@end35