]> granicus.if.org Git - clang/commitdiff
Put "incomplete implementation" warning under a flag.
authorTed Kremenek <kremenek@apple.com>
Mon, 14 Feb 2011 23:59:16 +0000 (23:59 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 14 Feb 2011 23:59:16 +0000 (23:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125535 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
test/SemaObjC/incomplete-implementation.m [new file with mode: 0644]

index 82ebf0b56d6eb237eff338b8059594089d608249..4e42fefdf1115bf478905b6aee26d02f54f8e830 100644 (file)
@@ -343,7 +343,8 @@ def err_conflicting_ivar_name : Error<
   "conflicting instance variable names: %0 vs %1">;
 def err_inconsistant_ivar_count : Error<
   "inconsistent number of instance variables specified">;
-def warn_incomplete_impl : Warning<"incomplete implementation">;
+def warn_incomplete_impl : Warning<"incomplete implementation">,
+  InGroup<DiagGroup<"incomplete-implementation">>;
 def note_undef_method_impl : Note<"method definition for %0 not found">;
 def note_required_for_protocol_at : 
   Note<"required for direct or indirect protocol %0">;
diff --git a/test/SemaObjC/incomplete-implementation.m b/test/SemaObjC/incomplete-implementation.m
new file mode 100644 (file)
index 0000000..612c331
--- /dev/null
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+@interface I
+- Meth; // expected-note{{method definition for 'Meth' not found}}
+@end
+
+@implementation  I  // expected-warning{{incomplete implementation}}
+@end
+
+@implementation I(CAT)
+- Meth {return 0;}
+@end
+
+#pragma GCC diagnostic ignored "-Wincomplete-implementation"
+@interface I2
+- Meth;
+@end
+
+@implementation  I2
+@end
+
+@implementation I2(CAT)
+- Meth {return 0;}
+@end
+
+