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. Tested x86_64-pc-linux-gnu, applying to trunk. gcc/testsuite/ChangeLog: PR c++/91506 * g++.dg/init/array60.C: New test. --- gcc/testsuite/g++.dg/init/array60.C | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 gcc/testsuite/g++.dg/init/array60.C diff --git a/gcc/testsuite/g++.dg/init/array60.C b/gcc/testsuite/g++.dg/init/array60.C new file mode 100644 index 00000000000..db5095a9bd5 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/array60.C @@ -0,0 +1,8 @@ +// PR c++/91506 + +double +test(int *arr, int x) +{ + double ret(double(arr[x]) + 1); + return ret; +} base-commit: 4f1d8bd5096cc234313b23f64cdac53a94ff75a2 -- 2.29.2