]> granicus.if.org Git - clang/commitdiff
objective-C: Improving diagnostocs for missing call to
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 10 Sep 2012 16:51:09 +0000 (16:51 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 10 Sep 2012 16:51:09 +0000 (16:51 +0000)
super's annotated methods. // rdar://6386358

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

include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDecl.cpp
test/SemaObjC/super-dealloc-attribute.m
test/SemaObjC/warn-missing-super.m
test/SemaObjCXX/warn-missing-super.mm

index a222e0aad30e0a71758931aa52f31b753dc717af..16afa972c55aafe62d6583f08a3db4ca5cc38b78 100644 (file)
@@ -739,7 +739,7 @@ def error_property_implemented : Error<"property %0 is already implemented">;
 def warn_objc_property_attr_mutually_exclusive : Warning<
   "property attributes '%0' and '%1' are mutually exclusive">,
   InGroup<ReadOnlySetterAttrs>, DefaultIgnore;
-def warn_objc_missing_super_dealloc : Warning<
+def warn_objc_missing_super_call : Warning<
   "method possibly missing a [super %0] call">,
   InGroup<ObjCMissingSuperCalls>;
 def error_dealloc_bad_result_type : Error<
index 5ed06d6daa549309b2ad68f2620440503e2a2de0..03b33af755c0752f94201c0ad2898b8a962363cd 100644 (file)
@@ -7832,8 +7832,8 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,
         computeNRVO(Body, getCurFunction());
     }
     if (getCurFunction()->ObjCShouldCallSuperDealloc) {
-      Diag(MD->getLocEnd(), diag::warn_objc_missing_super_dealloc)
-        << MD->getDeclName();
+      Diag(MD->getLocEnd(), diag::warn_objc_missing_super_call)
+        << MD->getSelector().getAsString();
       getCurFunction()->ObjCShouldCallSuperDealloc = false;
     }
     if (getCurFunction()->ObjCShouldCallSuperFinalize) {
index c2da8e92af48cfda6b71cdf3cea448c7a14d0452..3adf79116561e6b729859f268a03ec6430c6d99f 100644 (file)
@@ -26,6 +26,6 @@
 
 - (void)XXX {
   [super MyDealloc];
-} // expected-warning {{method possibly missing a [super 'XXX'] call}}
+} // expected-warning {{method possibly missing a [super XXX] call}}
 @end
 
index ba65ec8c8d61aaa00a4eaa8d1ac2e9d5ad186ad9..02b81651d7a21d0d9f8cdbdedaa90e251913b426 100644 (file)
@@ -41,11 +41,11 @@ __attribute__((objc_root_class))
 @end
 
 // RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s
-// CHECK: warn-missing-super.m:24:1: warning: method possibly missing a [super 'dealloc'] call
+// CHECK: warn-missing-super.m:24:1: warning: method possibly missing a [super dealloc] call
 // CHECK: 1 warning generated.
 
 // RUN: %clang_cc1 -fsyntax-only -fobjc-gc %s 2>&1 | FileCheck --check-prefix=CHECK-GC %s
-// CHECK-GC: warn-missing-super.m:24:1: warning: method possibly missing a [super 'dealloc'] call
+// CHECK-GC: warn-missing-super.m:24:1: warning: method possibly missing a [super dealloc] call
 // CHECK-GC: warn-missing-super.m:26:1: warning: method possibly missing a [super finalize] call
 // CHECK-GC: 2 warnings generated.
 
index 7383781535ecbf94a9c84c29f5868cee34de19f3..cd2a6cca767a0435bed482dff81fa7e075d5a286 100644 (file)
@@ -15,5 +15,5 @@ template<typename T> struct shared_ptr {
 - (void)dealloc
 {
        constexpr shared_ptr<int> dummy;
-} // expected-warning {{method possibly missing a [super 'dealloc'] call}}
+} // expected-warning {{method possibly missing a [super dealloc] call}}
 @end