OSDN Git Service

PR c++/37417
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Sep 2008 22:08:46 +0000 (22:08 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Sep 2008 22:08:46 +0000 (22:08 +0000)
* tree.c (array_type_nelts_top): Add size_one_node instead of
integer_one_node.

* g++.dg/ext/vla5.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140178 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/vla5.C [new file with mode: 0644]

index 9760ccf..cc70e9e 100644 (file)
@@ -1,3 +1,9 @@
+2008-09-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/37417
+       * tree.c (array_type_nelts_top): Add size_one_node instead of
+       integer_one_node.
+
 2008-09-09  Jason Merrill  <jason@redhat.com>
 
        PR c++/37439
index 9126763..fb3e8fc 100644 (file)
@@ -1461,7 +1461,7 @@ array_type_nelts_top (tree type)
 {
   return fold_build2 (PLUS_EXPR, sizetype,
                      array_type_nelts (type),
-                     integer_one_node);
+                     size_one_node);
 }
 
 /* Return, as an INTEGER_CST node, the number of elements for TYPE
index 55464c0..6e14ee5 100644 (file)
@@ -1,5 +1,8 @@
 2008-09-09  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c++/37417
+       * g++.dg/ext/vla5.C: New test.
+
        PR middle-end/37356
        * g++.dg/tree-ssa/pr37356.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/ext/vla5.C b/gcc/testsuite/g++.dg/ext/vla5.C
new file mode 100644 (file)
index 0000000..021d484
--- /dev/null
@@ -0,0 +1,10 @@
+// PR c++/37417
+// Testcase by Martin Michlmayr <tbm@cyrius.com>
+// { dg-do compile }
+// { dg-options "-O" }
+
+void
+test (int a)
+{
+  new (char[a]);
+}