* decl.c (initialize_local_var): If TREE_USED is set on the type,
set also DECL_READ_P on the decl.
* c-c++-common/Wunused-var-11.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160387
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-06-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/44443
+ * decl.c (initialize_local_var): If TREE_USED is set on the type,
+ set also DECL_READ_P on the decl.
+
2010-05-25 Dodji Seketeli <dodji@redhat.com>
PR c++/44188
/* Compute and store the initial value. */
already_used = TREE_USED (decl) || TREE_USED (type);
+ if (TREE_USED (type))
+ DECL_READ_P (decl) = 1;
/* Generate a cleanup, if necessary. */
cleanup = cxx_maybe_build_cleanup (decl);
+2010-06-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/44443
+ * c-c++-common/Wunused-var-11.c: New test.
+
2010-06-07 Jan Hubicka <jh@suse.cz>
* gcc.dg/ipa/pure-const-1.c: New testcase.
--- /dev/null
+/* PR c++/44443 */
+/* { dg-options "-Wunused" } */
+/* { dg-do compile } */
+
+int i;
+
+void
+f1 ()
+{
+ const int * __attribute__((unused)) a = &i;
+ const int *b __attribute__((unused)) = &i;
+}