c++: Add fixed test [PR91506]
authorMarek Polacek <polacek@redhat.com>
Thu, 10 Dec 2020 20:34:19 +0000 (15:34 -0500)
committerMarek Polacek <polacek@redhat.com>
Thu, 10 Dec 2020 20:35:20 +0000 (15:35 -0500)
Pre-r11-557 we issued a bogus

  error: parameter may not have variably modified type 'double [x]'

but now we compile this, as we should.

gcc/testsuite/ChangeLog:

PR c++/91506
* g++.dg/init/array60.C: New test.

gcc/testsuite/g++.dg/init/array60.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/init/array60.C b/gcc/testsuite/g++.dg/init/array60.C
new file mode 100644 (file)
index 0000000..db5095a
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/91506
+
+double
+test(int *arr, int x)
+{
+    double ret(double(arr[x]) + 1);
+    return ret;
+}