diff options
| author | Steve Naroff <snaroff@apple.com> | 2008-02-08 22:06:17 +0000 |
|---|---|---|
| committer | Steve Naroff <snaroff@apple.com> | 2008-02-08 22:06:17 +0000 |
| commit | a3699224496f21dacc38ce627e230a42b29ae23b (patch) | |
| tree | 330e859d615c6a93e0976140f964f8a575da03b1 /clang/test | |
| parent | f2bd1387b0d74530acd7a452fdc077f2afb29357 (diff) | |
| download | bcm5719-llvm-a3699224496f21dacc38ce627e230a42b29ae23b.tar.gz bcm5719-llvm-a3699224496f21dacc38ce627e230a42b29ae23b.zip | |
A bunch-o changes to fix <rdar://problem/5716046> incomplete implementation of ObjC class warning is incomplete
As part of this fix, I made a low-level change to the text diagnostics machinery (to basically avoid printing duplicate source lines/carets when you have multiple diagnostics that refer to the same exact place). For now, this only happens with we don't have a source range (could be extended to support source ranges as well).
llvm-svn: 46897
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Sema/method-undef-category-warn-1.m | 16 | ||||
| -rw-r--r-- | clang/test/Sema/method-undefined-warn-1.m | 16 | ||||
| -rw-r--r-- | clang/test/Sema/undef-protocol-methods-1.m | 29 |
3 files changed, 37 insertions, 24 deletions
diff --git a/clang/test/Sema/method-undef-category-warn-1.m b/clang/test/Sema/method-undef-category-warn-1.m index af5a0e2befa..792c24d748f 100644 --- a/clang/test/Sema/method-undef-category-warn-1.m +++ b/clang/test/Sema/method-undef-category-warn-1.m @@ -4,23 +4,27 @@ @end @protocol P -- (void) Pmeth; // expected-warning {{method definition for 'Pmeth' not found}} -- (void) Pmeth1; // expected-warning {{method definition for 'Pmeth1' not found}} +- (void) Pmeth; +- (void) Pmeth1; @end @interface MyClass1(CAT) <P> -- (void) meth2; // expected-warning {{method definition for 'meth2' not found}} +- (void) meth2; @end -@implementation MyClass1(CAT) // expected-warning {{incomplete implementation of category 'CAT'}} +@implementation MyClass1(CAT) // expected-warning {{incomplete implementation}} \ + expected-warning {{method definition for 'meth2' not found}} \ + expected-warning {{method definition for 'Pmeth' not found}} - (void) Pmeth1{} @end @interface MyClass1(DOG) <P> -- (void)ppp; // expected-warning {{method definition for 'ppp' not found}} +- (void)ppp; @end -@implementation MyClass1(DOG) // expected-warning {{incomplete implementation of category 'DOG'}} +@implementation MyClass1(DOG) // expected-warning {{incomplete implementation}} \ + expected-warning {{method definition for 'ppp' not found}} \ + expected-warning {{method definition for 'Pmeth1' not found}} - (void) Pmeth {} @end diff --git a/clang/test/Sema/method-undefined-warn-1.m b/clang/test/Sema/method-undefined-warn-1.m index 0e4e6a11728..9e646f82f73 100644 --- a/clang/test/Sema/method-undefined-warn-1.m +++ b/clang/test/Sema/method-undefined-warn-1.m @@ -3,12 +3,12 @@ @interface INTF - (void) meth; - (void) meth : (int) arg1; -- (int) int_meth; // expected-warning {{method definition for 'int_meth' not found}} -+ (int) cls_meth; // expected-warning {{method definition for 'cls_meth' not found}} -+ (void) cls_meth1 : (int) arg1; // expected-warning {{method definition for 'cls_meth1:' not found}} +- (int) int_meth; ++ (int) cls_meth; ++ (void) cls_meth1 : (int) arg1; @end -@implementation INTF // expected-warning {{incomplete implementation of class 'INTF'}} +@implementation INTF // expected-warning {{incomplete implementation}} expected-warning {{method definition for 'int_meth' not found}} expected-warning {{method definition for 'cls_meth' not found}} expected-warning {{method definition for 'cls_meth1:' not found}} - (void) meth {} - (void) meth : (int) arg2{} - (void) cls_meth1 : (int) arg2{} @@ -17,12 +17,12 @@ @interface INTF1 - (void) meth; - (void) meth : (int) arg1; -- (int) int_meth; // expected-warning {{method definition for 'int_meth' not found}} -+ (int) cls_meth; // expected-warning {{method definition for 'cls_meth' not found}} -+ (void) cls_meth1 : (int) arg1; // expected-warning {{method definition for 'cls_meth1:' not found}} +- (int) int_meth; ++ (int) cls_meth; ++ (void) cls_meth1 : (int) arg1; @end -@implementation INTF1 // expected-warning {{incomplete implementation of class 'INTF1'}} +@implementation INTF1 // expected-warning {{incomplete implementation}} expected-warning {{method definition for 'int_meth' not found}} expected-warning {{method definition for 'cls_meth' not found}} expected-warning {{method definition for 'cls_meth1:' not found}} - (void) meth {} - (void) meth : (int) arg2{} - (void) cls_meth1 : (int) arg2{} diff --git a/clang/test/Sema/undef-protocol-methods-1.m b/clang/test/Sema/undef-protocol-methods-1.m index 748b151fde4..9ad3593c6c4 100644 --- a/clang/test/Sema/undef-protocol-methods-1.m +++ b/clang/test/Sema/undef-protocol-methods-1.m @@ -1,31 +1,40 @@ // RUN: clang -fsyntax-only -verify %s @protocol P1 -- (void) P1proto; // expected-warning {{method definition for 'P1proto' not found}} -+ (void) ClsP1Proto; // expected-warning {{method definition for 'ClsP1Proto' not found}} +- (void) P1proto; ++ (void) ClsP1Proto; - (void) DefP1proto; @end @protocol P2 -- (void) P2proto; // expected-warning {{method definition for 'P2proto' not found}} -+ (void) ClsP2Proto; // expected-warning {{method definition for 'ClsP2Proto' not found}} +- (void) P2proto; ++ (void) ClsP2Proto; @end @protocol P3<P2> -- (void) P3proto; // expected-warning {{method definition for 'P3proto' not found}} -+ (void) ClsP3Proto; // expected-warning {{method definition for 'ClsP3Proto' not found}} +- (void) P3proto; ++ (void) ClsP3Proto; + (void) DefClsP3Proto; @end @protocol PROTO<P1, P3> -- (void) meth; // expected-warning {{method definition for 'meth' not found}} -- (void) meth : (int) arg1; // expected-warning {{method definition for 'meth:' not found}} -+ (void) cls_meth : (int) arg1; // expected-warning {{method definition for 'cls_meth:' not found}} +- (void) meth; +- (void) meth : (int) arg1; ++ (void) cls_meth : (int) arg1; @end @interface INTF <PROTO> @end -@implementation INTF // expected-warning {{incomplete implementation of class 'INTF'}} +@implementation INTF // expected-warning {{incomplete implementation}} \ + expected-warning {{method definition for 'meth' not found}} \ + expected-warning {{method definition for 'meth:' not found}} \ + expected-warning {{method definition for 'cls_meth:' not found}} \ + expected-warning {{method definition for 'P3proto' not found}} \ + expected-warning {{method definition for 'ClsP3Proto' not found}} \ + expected-warning {{method definition for 'P2proto' not found}} \ + expected-warning {{method definition for 'ClsP2Proto' not found}} \ + expected-warning {{method definition for 'ClsP1Proto' not found}} \ + expected-warning {{method definition for 'P1proto' not found}} - (void) DefP1proto{} + (void) DefClsP3Proto{} |

