From da2f0f2c26ca9ddeac3c5fb917a2bf89bcf38df9 Mon Sep 17 00:00:00 2001 From: pinskia Date: Wed, 24 Jan 2007 06:01:09 +0000 Subject: [PATCH] 2007-01-23 Andrew Pinski PR objc/27438 * objc-act.c (objc_add_static_instance): Mark the decl as TREE_USED. 2007-01-23 Andrew Pinski PR objc/27438 * objc.dg/const-str-12.m: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121102 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/objc/ChangeLog | 6 ++++++ gcc/objc/objc-act.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/objc.dg/const-str-12.m | 15 +++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 gcc/testsuite/objc.dg/const-str-12.m diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index f3aeb9b3bdd8..033ba3eeb117 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,9 @@ +2007-01-23 Andrew Pinski + + PR objc/27438 + * objc-act.c (objc_add_static_instance): Mark the decl as + TREE_USED. + 2007-01-20 Andrew Pinski PR objc/30479 diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 86bfd37b6654..b94bc0a3f0d7 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -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. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4ca9959152a8..10cc9718c390 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-01-23 Andrew Pinski + + PR objc/27438 + * objc.dg/const-str-12.m: New test. + 2007-01-23 Jerry DeLisle 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 index 000000000000..95a6bef3241d --- /dev/null +++ b/gcc/testsuite/objc.dg/const-str-12.m @@ -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" } */ + + -- 2.47.3