From d09074f0ca06626914108f1c0d4e70adeb851e01 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Wed, 3 Oct 2012 02:35:19 +0000 Subject: [PATCH] InlineObjCInstanceMethod.m: Remove lines introduced in r165079. It broke some builds, on FreeBSD, Linux and Windows. error: 'warning' diagnostics expected but not seen: Line 94: types are incompatible 1 error generated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165088 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../inlining/InlineObjCInstanceMethod.m | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/test/Analysis/inlining/InlineObjCInstanceMethod.m b/test/Analysis/inlining/InlineObjCInstanceMethod.m index d1b1d945a1..48556dcd49 100644 --- a/test/Analysis/inlining/InlineObjCInstanceMethod.m +++ b/test/Analysis/inlining/InlineObjCInstanceMethod.m @@ -84,28 +84,3 @@ void randomlyMessageAnObject(MyClass *arr[], int i) { (void)[arr[i] getInt]; } - - -@interface EvilChild : MyParent -- (id)getInt; -@end - -@implementation EvilChild -- (id)getInt { // expected-warning {{types are incompatible}} - return self; -} -@end - -int testNonCovariantReturnType() { - MyParent *obj = [[EvilChild alloc] init]; - - // Devirtualization allows us to directly call -[EvilChild getInt], but - // that returns an id, not an int. There is an off-by-default warning for - // this, -Woverriding-method-mismatch, and an on-by-default analyzer warning, - // osx.cocoa.IncompatibleMethodTypes. This code would probably crash at - // runtime, but at least the analyzer shouldn't crash. - int x = 1 + [obj getInt]; - - [obj release]; - return 5/(x-1); // no-warning -} -- 2.40.0