aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-03-26 17:07:06 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-03-26 17:07:06 +0000
commit3d9ce907a7a77dba1f81bfff6af05f7cbe31b115 (patch)
tree733778523f168e27c27be641627197b03d07a891
parent48e36464eebff28bd08793d1c3570c10bf3a59e7 (diff)
Make diagnostic clearer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128343 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td4
-rw-r--r--test/SemaObjC/call-super-2.m14
-rw-r--r--test/SemaObjC/method-not-defined.m6
-rw-r--r--test/SemaObjC/property-lookup-in-id.m2
4 files changed, 13 insertions, 13 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index 670b87883e..cee572e7a2 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -2716,9 +2716,9 @@ def err_imaginary_not_supported : Error<"imaginary types are not supported">;
def warn_root_inst_method_not_found : Warning<
"instance method %0 is being used on 'Class' which is not in the root class">;
def warn_class_method_not_found : Warning<
- "method %objcclass0 not found (return type defaults to 'id')">;
+ "class method %objcclass0 not found (return type defaults to 'id')">;
def warn_inst_method_not_found : Warning<
- "method %objcinstance0 not found (return type defaults to 'id')">;
+ "instance method %objcinstance0 not found (return type defaults to 'id')">;
def error_no_super_class_message : Error<
"no @interface declaration found in class messaging of %0">;
def error_root_class_cannot_use_super : Error<
diff --git a/test/SemaObjC/call-super-2.m b/test/SemaObjC/call-super-2.m
index 84a625c404..d77b759ffa 100644
--- a/test/SemaObjC/call-super-2.m
+++ b/test/SemaObjC/call-super-2.m
@@ -35,8 +35,8 @@ id objc_getClass(const char *s);
@implementation Derived
+ (int) class_func1
{
- int i = (size_t)[self class_func0]; // expected-warning {{method '+class_func0' not found (return type defaults to 'id')}}
- return i + (size_t)[super class_func0]; // expected-warning {{method '+class_func0' not found (return type defaults to 'id')}}
+ int i = (size_t)[self class_func0]; // expected-warning {{class method '+class_func0' not found (return type defaults to 'id')}}
+ return i + (size_t)[super class_func0]; // expected-warning {{class method '+class_func0' not found (return type defaults to 'id')}}
}
+ (int) class_func2
{
@@ -55,8 +55,8 @@ id objc_getClass(const char *s);
}
+ (int) class_func5
{
- int i = (size_t)[Derived class_func0]; // expected-warning {{method '+class_func0' not found (return type defaults to 'id')}}
- return i + (size_t)[Object class_func0]; // expected-warning {{method '+class_func0' not found (return type defaults to 'id')}}
+ int i = (size_t)[Derived class_func0]; // expected-warning {{class method '+class_func0' not found (return type defaults to 'id')}}
+ return i + (size_t)[Object class_func0]; // expected-warning {{class method '+class_func0' not found (return type defaults to 'id')}}
}
+ (int) class_func6
{
@@ -68,7 +68,7 @@ id objc_getClass(const char *s);
}
- (int) instance_func1
{
- int i = (size_t)[self instance_func0]; // expected-warning {{method '-instance_func0' not found (return type defaults to 'id'))}}
+ int i = (size_t)[self instance_func0]; // expected-warning {{instance method '-instance_func0' not found (return type defaults to 'id'))}}
return i + (size_t)[super instance_func0]; // expected-warning {{'Object' may not respond to 'instance_func0')}}
}
- (int) instance_func2
@@ -85,8 +85,8 @@ id objc_getClass(const char *s);
}
- (int) instance_func5
{
- int i = (size_t)[Derived instance_func1]; // expected-warning {{method '+instance_func1' not found (return type defaults to 'id')}}
- return i + (size_t)[Object instance_func1]; // expected-warning {{method '+instance_func1' not found (return type defaults to 'id')}}
+ int i = (size_t)[Derived instance_func1]; // expected-warning {{class method '+instance_func1' not found (return type defaults to 'id')}}
+ return i + (size_t)[Object instance_func1]; // expected-warning {{class method '+instance_func1' not found (return type defaults to 'id')}}
}
- (int) instance_func6
{
diff --git a/test/SemaObjC/method-not-defined.m b/test/SemaObjC/method-not-defined.m
index 78bf650272..ed68b22945 100644
--- a/test/SemaObjC/method-not-defined.m
+++ b/test/SemaObjC/method-not-defined.m
@@ -7,7 +7,7 @@ void test() {
Foo *fooObj;
id obj;
- [[Foo alloc] init]; // expected-warning {{method '+alloc' not found (return type defaults to 'id')}} expected-warning {{method '-init' not found (return type defaults to 'id')}}
- [fooObj notdefined]; // expected-warning {{method '-notdefined' not found (return type defaults to 'id')}}
- [obj whatever:1 :2 :3]; // expected-warning {{method '-whatever:::' not found (return type defaults to 'id'))}}
+ [[Foo alloc] init]; // expected-warning {{class method '+alloc' not found (return type defaults to 'id')}} expected-warning {{instance method '-init' not found (return type defaults to 'id')}}
+ [fooObj notdefined]; // expected-warning {{instance method '-notdefined' not found (return type defaults to 'id')}}
+ [obj whatever:1 :2 :3]; // expected-warning {{instance method '-whatever:::' not found (return type defaults to 'id'))}}
}
diff --git a/test/SemaObjC/property-lookup-in-id.m b/test/SemaObjC/property-lookup-in-id.m
index 389e0bdba7..86da48e851 100644
--- a/test/SemaObjC/property-lookup-in-id.m
+++ b/test/SemaObjC/property-lookup-in-id.m
@@ -25,7 +25,7 @@ extern id NSApp;
- (void)startFSEventGathering:(id)sender
{
- fsEventStream = [NSApp delegate].fsEventStream; // expected-warning {{warning: method '-delegate' not found (return type defaults to 'id')}} \
+ fsEventStream = [NSApp delegate].fsEventStream; // expected-warning {{warning: instance method '-delegate' not found (return type defaults to 'id')}} \
// expected-error {{property 'fsEventStream' not found on object of type 'id'}}
}