aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-05-31 23:10:15 +0000
committerSteve Naroff <snaroff@apple.com>2008-05-31 23:10:15 +0000
commit19b87d28317f260192d91d723b80b079711d7356 (patch)
tree50fdbb78b8bb931df6fda8821059717dedab470b
parentaa73eec076a2545671f78cb4e82536ec39f040eb (diff)
Add some more test cases that demonstrate clang is a bit stricter than GCC. These can be fixed lazily if they become a problem.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51830 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Sema/conditional-expr.m23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Sema/conditional-expr.m b/test/Sema/conditional-expr.m
index d2620416fd..e3cd041d3a 100644
--- a/test/Sema/conditional-expr.m
+++ b/test/Sema/conditional-expr.m
@@ -19,3 +19,26 @@
return self;
}
@end
+
+@interface DTFilterOutputStream2
+- nextOutputStream;
+@end
+
+@implementation DTFilterOutputStream2 // expected-warning {{incomplete implementation}} expected-warning {{method definition for 'nextOutputStream' not found}}
+- (id)initWithNextOutputStream:(id <DTOutputStreams>) outputStream {
+ id <DTOutputStreams> nextOutputStream = [self nextOutputStream];
+ // GCC warns about both of these.
+ self = nextOutputStream; // expected-error {{incompatible type assigning 'id<DTOutputStreams>', expected 'DTFilterOutputStream2 *'}}
+ return nextOutputStream ? nextOutputStream : self; // expected-error {{incompatible operand types ('id<DTOutputStreams>' and 'DTFilterOutputStream2 *')}}
+}
+@end
+
+// No @interface declaration for DTFilterOutputStream3
+@implementation DTFilterOutputStream3 // expected-warning {{cannot find interface declaration for 'DTFilterOutputStream3'}}
+- (id)initWithNextOutputStream:(id <DTOutputStreams>) outputStream {
+ id <DTOutputStreams> nextOutputStream = [self nextOutputStream];
+ // GCC warns about both of these as well (no errors).
+ self = nextOutputStream; // expected-error {{incompatible type assigning 'id<DTOutputStreams>', expected 'DTFilterOutputStream3 *'}}
+ return nextOutputStream ? nextOutputStream : self; // expected-error {{incompatible operand types ('id<DTOutputStreams>' and 'DTFilterOutputStream3 *')}}
+}
+@end