From: Marek Polacek Date: Thu, 10 Dec 2020 20:34:19 +0000 (-0500) Subject: c++: Add fixed test [PR91506] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=96a5c483afbe0cb3fb037641bf2b5658531d9255;p=gcc.git c++: Add fixed test [PR91506] 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. --- 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; +}