Issue 24873 - dmd v2.109.1: static foreach over tuple: segfault
Summary: dmd v2.109.1: static foreach over tuple: segfault
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-23 00:38 UTC by kdevel
Modified: 2024-11-23 13:24 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description kdevel 2024-11-23 00:38:27 UTC
crash.d:
```
import std;

void main ()
{
   auto tup = tuple!(string, string, string);
   static foreach (j, t; tup)
   {
   }
}
```
$ dmd crash.d 
Segmentation fault
$ dmd --version
DMD64 D Compiler v2.109.1
Copyright (C) 1999-2024 by The D Language Foundation, All Rights Reserved written by Walter Bright
Comment 1 Nick Treleaven 2024-11-23 13:24:22 UTC
Reduced:

struct Tuple(T...)
{
    T fields;
    alias fields this;
}

void main ()
{
   Tuple!(string) tup;
   static foreach (j, t; tup)
   {
   }
}