blob: 195cd663acdaa0056077941a4f7bf602178cf90e [file] [log] [blame]
Patrick Beardb2f68202012-04-06 18:12:22 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wattributes -Wobjc-root-class %s
2@interface RootClass {} // expected-warning {{class 'RootClass' defined without specifying a base class}} \
3 // expected-note {{add a super class to fix this problem}}
4@end
5@implementation RootClass
6@end
7
8__attribute__((objc_root_class))
9@interface NonRootClass : RootClass // expected-error {{objc_root_class attribute may only be specified on a root class declaration}}
10@end
11@implementation NonRootClass
12@end
13
14__attribute__((objc_root_class)) static void nonClassDeclaration() // expected-error {{attribute may only be applied to an Objective-C interface}}
15{
16}