]> granicus.if.org Git - clang/commitdiff
ObjectiveC. produce more expressive warning when
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 14 Jan 2014 20:35:13 +0000 (20:35 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 14 Jan 2014 20:35:13 +0000 (20:35 +0000)
-Wselector detects an unimplemented method used
in an @selector expression. // rdar://15781538

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199255 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
test/PCH/chain-selectors.m
test/SemaObjC/selector-3.m

index 18b6fa2e8b49b665f948f4462c059af59394652d..e956e851b63fbdb9ce1fb7c704e9c3be408d0232 100644 (file)
@@ -855,7 +855,8 @@ def warn_auto_implicit_atomic_property : Warning<
   "property is assumed atomic when auto-synthesizing the property">,
   InGroup<ImplicitAtomic>, DefaultIgnore;
 def warn_unimplemented_selector:  Warning<
-  "creating selector for nonexistent method %0">, InGroup<Selector>, DefaultIgnore;
+  "using @selector on method %0 with no implementation in translation unit">, 
+  InGroup<Selector>, DefaultIgnore;
 def warn_unimplemented_protocol_method : Warning<
   "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
 
index f2bfc4b9d3dfca80de9d87f625e366dae369102a..5de17725ff95028a017c01ae9c7f620c0bc3e272 100644 (file)
@@ -18,9 +18,9 @@ void bar() {
   // FIXME: Can't verify notes in headers
   //[a f2];
 
-  (void)@selector(x); // expected-warning {{creating selector for nonexistent method 'x'}}
-  (void)@selector(y); // expected-warning {{creating selector for nonexistent method 'y'}}
-  (void)@selector(e); // expected-warning {{creating selector for nonexistent method 'e'}}
+  (void)@selector(x); // expected-warning {{using @selector on method 'x' with no implementation in translation unit}}
+  (void)@selector(y); // expected-warning {{using @selector on method 'y' with no implementation in translation unit}}
+  (void)@selector(e); // expected-warning {{using @selector on method 'e' with no implementation in translation unit}}
 }
 
 @implementation X (Blah)
index 35a465170704a36536650b5c755d8020709f418c..76e14b16c1f275b39dce6156d6d3d31cf8dc2a84 100644 (file)
@@ -14,7 +14,7 @@
 - (void) foo
 {
   SEL a,b,c;
-  a = @selector(b1ar);  // expected-warning {{creating selector for nonexistent method 'b1ar'}}
+  a = @selector(b1ar);  // expected-warning {{using @selector on method 'b1ar' with no implementation in translation unit}}
   b = @selector(bar);
 }
 @end
@@ -25,7 +25,7 @@
 
 SEL func()
 {
-    return  @selector(length);  // expected-warning {{creating selector for nonexistent method 'length'}}
+    return  @selector(length);  // expected-warning {{using @selector on method 'length' with no implementation in translation unit}}
 }
 
 // rdar://9545564
@@ -69,7 +69,7 @@ extern SEL MySelector(SEL s);
 
 @implementation INTF
 - (void) Meth {
-  if( [cnx respondsToSelector:MySelector(@selector( _setQueue: ))] ) // expected-warning {{creating selector for nonexistent method '_setQueue:'}} 
+  if( [cnx respondsToSelector:MySelector(@selector( _setQueue: ))] ) // expected-warning {{using @selector on method '_setQueue:' with no implementation in translation unit}}
   {
   }