aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@redhat.com>2010-05-17 17:24:32 +0000
committerJakub Jelinek <jakub@gcc.gnu.org>2010-05-17 19:24:32 +0200
commitad13f2299cefa72529059e21385c4c49f1491181 (patch)
tree786dcd92a7ad0fc0015905fd8c1894a4eca21613 /gcc/cp
parentf145213fcc63518e181ae5b74a38f75555f6a741 (diff)
downloadgcc-ad13f2299cefa72529059e21385c4c49f1491181.zip
gcc-ad13f2299cefa72529059e21385c4c49f1491181.tar.gz
gcc-ad13f2299cefa72529059e21385c4c49f1491181.tar.bz2
re PR c++/44108 (-Wunused-but-set-variable does not consider array sizing use of a const variable)
PR c++/44108 * decl.c (compute_array_index_type): Call mark_rvalue_use. * c-c++-common/Wunused-var-8.c: New test. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r159497
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 84b8ae5..acc111f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-17 Dodji Seketeli <dodji@redhat.com>
+ Jason Merrill <jason@redhat.com>
+
+ PR c++/44108
+ * decl.c (compute_array_index_type): Call mark_rvalue_use.
+
2010-05-15 Jason Merrill <jason@redhat.com>
* cp-tree.h (TYPE_NOEXCEPT_P): New macro.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 148bcf5..0636aba 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7369,6 +7369,8 @@ compute_array_index_type (tree name, tree size)
/* The size might be the result of a cast. */
STRIP_TYPE_NOPS (size);
+ size = mark_rvalue_use (size);
+
/* It might be a const variable or enumeration constant. */
size = integral_constant_value (size);
if (error_operand_p (size))