]> git.ipfire.org Git - people/ms/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:06:07 +0000 (22:06 -0800)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Wed, 24 Jan 2007 06:06:07 +0000 (22:06 -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: r121103

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 2b671814bafcdb7fee48b316554964011a2ad313..da52a873b3fd75736cd6fd0c896bfe329254b983 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-21  Andrew Pinski  <pinskia@gmail.com>
 
        PR objc/30479
index cc899743769c63164be3fc2a12766901ebc4aeec..8f07158e3ef3616b3a36316da3f6a96577781764 100644 (file)
@@ -1998,6 +1998,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 5345a86f449735e027933672fb16dcf4bf7e0b28..cd5496b818116d3d44b5f8bddb636b80d5f2026a 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-21 Andrew Pinski  <pinskia@gmail.com>
 
        PR objc/30479
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" } */
+
+