Comment #0 by verylonglogin.reg — 2013-09-22T23:16:21Z
---
struct S
{ int[2][1] a21; }
void main()
{
int[2][1] a21 = [1, 2]; // ok
static assert(!__traits(compiles, a21 = [1])); // ok
static assert(!__traits(compiles, { static S ss = { a21: [1]}; })); // assert fails, creates a21 = [[1, 0]]
static S ss = { a21: [1, 2]}; // Error: array initializer has 2 elements, but array length is 1
S s = S([1, 2]); // [Issue 11105] Error: cannot implicitly convert expression ([1, 2]) of type int[] to int[2u][1u]
}
---
Some indices ICEs the compiler:
---
struct S
{ int[2][2] a22; }
static S ss = { a22: [1]}; // Assertion failure: 'sz == vsz || sz * dim <= vsz' on line 144 in file 'todt.c'
---
Comment #1 by razvan.nitu1305 — 2023-07-19T11:54:09Z
The ice is no longer present.
Comment #2 by robert.schadek — 2024-12-13T18:11:50Z