view gcc/testsuite/gdc.test/fail_compilation/fail11426.d @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 1830386684a0
children
line wrap: on
line source

/*
TEST_OUTPUT:
---
fail_compilation/fail11426.d(15): Error: cannot implicitly convert expression `udarr` of type `uint[]` to `int[]`
fail_compilation/fail11426.d(16): Error: cannot implicitly convert expression `usarr` of type `uint[1]` to `int[]`
fail_compilation/fail11426.d(18): Error: cannot implicitly convert expression `udarr` of type `uint[]` to `int[]`
fail_compilation/fail11426.d(19): Error: cannot implicitly convert expression `usarr` of type `uint[1]` to `int[]`
---
*/
void main()
{
    uint[]  udarr;
    uint[1] usarr;

    int[1] arr1; arr1 = udarr;  // Error, OK
    int[1] arr2; arr2 = usarr;  // Error, OK

    int[1] arr3 = udarr;    // accepted, BAD!
    int[1] arr4 = usarr;    // accepted, BAD!
}