]> gcc.gnu.org Git - gcc.git/commitdiff
re PR objc/27438 ([unit-at-a-time] '_OBJC_INSTANCE_0' defined but not used warning)
authorAndrew Pinski <pinskia@gmail.com>
Wed, 24 Jan 2007 06:01:09 +0000 (22:01 -0800)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Wed, 24 Jan 2007 06:01:09 +0000 (22:01 -0800)
2007-01-23  Andrew Pinski  <pinskia@gmail.com>

        PR objc/27438
        * objc-act.c (objc_add_static_instance): Mark the decl as
        TREE_USED.

2007-01-23  Andrew Pinski  <pinskia@gmail.com>

        PR objc/27438
        * objc.dg/const-str-12.m: New test.

From-SVN: r121102

gcc/objc/ChangeLog
gcc/objc/objc-act.c
gcc/testsuite/ChangeLog
gcc/testsuite/objc.dg/const-str-12.m [new file with mode: 0644]

index f3aeb9b3bdd83cf2f4b36866d4ba13e211615698..033ba3eeb117eaf8266a096f05aea319cb977c0f 100644 (file)
@@ -1,3 +1,9 @@
+2007-01-23  Andrew Pinski  <pinskia@gmail.com>
+
+       PR objc/27438
+       * objc-act.c (objc_add_static_instance): Mark the decl as
+       TREE_USED.
+
 2007-01-20  Andrew Pinski  <pinskia@gmail.com>
 
        PR objc/30479
index 86bfd37b6654d6c47a197c4d1965b08a8d22771f..b94bc0a3f0d70777f324a0fe349308b8576a6028 100644 (file)
@@ -2007,6 +2007,7 @@ objc_add_static_instance (tree constructor, tree class_decl)
   DECL_COMMON (decl) = 1;
   TREE_STATIC (decl) = 1;
   DECL_ARTIFICIAL (decl) = 1;
+  TREE_USED (decl) = 1;
   DECL_INITIAL (decl) = constructor;
 
   /* We may be writing something else just now.
index 4ca9959152a8da0599a569a17a3574c8eabe56f8..10cc9718c3900b8a06dd9d6042b9b8f00580a76c 100644 (file)
@@ -1,3 +1,8 @@
+2007-01-23  Andrew Pinski  <pinskia@gmail.com>
+
+       PR objc/27438
+       * objc.dg/const-str-12.m: New test.
+
 2007-01-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR fortran/30532
diff --git a/gcc/testsuite/objc.dg/const-str-12.m b/gcc/testsuite/objc.dg/const-str-12.m
new file mode 100644 (file)
index 0000000..95a6bef
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-options "-Wall -funit-at-a-time -fgnu-runtime" } */
+/* { dg-do compile }  */
+/* PR objc/27438, make sure that the decl produced by the front-end
+   does not cause a warning to be produced. */
+
+@interface NXConstantString
+{
+  void *isa;
+  const char * const nxcsptr;
+  const unsigned int nxcslen;
+}
+@end
+NXConstantString *a =   @"NSInconsistentArchiveException"; /* { dg-bogus "defined but not used" } */
+
+
This page took 0.136466 seconds and 5 git commands to generate.