mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 13:06:40 +00:00

A significant number of our tests in C accidentally use functions without prototypes. This patch converts the function signatures to have a prototype for the situations where the test is not specific to K&R C declarations. e.g., void func(); becomes void func(void); This is the third batch of tests being updated (there are a significant number of other tests left to be updated).
21 lines
802 B
Objective-C
21 lines
802 B
Objective-C
// RUN: %clang_cc1 -fsyntax-only -verify -Wattributes -Wobjc-root-class %s
|
|
@interface RootClass {} // expected-warning {{class 'RootClass' defined without specifying a base class}} \
|
|
// expected-note {{add a super class to fix this problem}}
|
|
@end
|
|
@implementation RootClass
|
|
@end
|
|
|
|
__attribute__((objc_root_class))
|
|
@interface NonRootClass : RootClass // expected-error {{objc_root_class attribute may only be specified on a root class declaration}}
|
|
@end
|
|
@implementation NonRootClass
|
|
@end
|
|
|
|
__attribute__((objc_root_class)) static void nonClassDeclaration(void) // expected-error {{'objc_root_class' attribute only applies to Objective-C interfaces}}
|
|
{
|
|
}
|
|
|
|
__attribute__((objc_root_class(1))) // expected-error {{'objc_root_class' attribute takes no arguments}}
|
|
@interface I1
|
|
@end
|