Fix #20907 - DMD segfaults with static array length parameter derived from left-shifted template parameter property (#20919)

This commit is contained in:
Dennis 2025-02-28 21:46:10 +01:00 committed by GitHub
parent 34cf3a9503
commit 3945e81615
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -240,6 +240,16 @@ void test8()
/*********************************************************/
// https://github.com/dlang/dmd/issues/20907
struct Bar { enum bar = 1; }
void foo(A)(A[], A[1 << A.bar]) {}
void test20907()
{
foo((Bar[]).init, (Bar[2]).init);
}
/*********************************************************/
int main()
{
test1();
@ -250,6 +260,7 @@ int main()
test6();
test7();
test8();
test20907();
printf("Success\n");
return 0;