brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · bbf154c Raw
53 lines · plain
1// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -Wdealloc-in-category -verify %s2// RUN: not %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -Wdealloc-in-category -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s3 4@protocol NSObject5- dealloc; // expected-error {{return type must be correctly specified as 'void' under ARC, instead of 'id'}}6// CHECK: fix-it:"{{.*}}":{5:3-5:3}:"(void)"7@end8 9@protocol Foo <NSObject> @end10 11@interface Root <Foo>12@end13 14@interface Baz : Root {15}16@end17 18@implementation Baz19-  (id) dealloc { // expected-error {{return type must be correctly specified as 'void' under ARC, instead of 'id'}}20// CHECK: fix-it:"{{.*}}":{19:5-19:7}:"void"21}22 23@end24 25@interface Base26- (void)dealloc;27@end28 29@interface Subclass : Base30@end 31 32@interface Subclass (CAT)33- (void)dealloc;34@end35 36@implementation Subclass (CAT)37- (void)dealloc { // expected-warning {{-dealloc is being overridden in a category}}38}39@end40 41@interface NSObject @end42@interface NSError:NSObject43@end44 45@interface NSError(CAT)46- (NSError *)MCCopyAsPrimaryError __attribute__((objc_method_family(new)));47@end48@implementation NSError(CAT)49- (NSError *)MCCopyAsPrimaryError {50  return 0;51}52@end53