[Issue 23386] New: Segfault on enum member UDA inside template
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Oct 4 22:03:36 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23386
Issue ID: 23386
Summary: Segfault on enum member UDA inside template
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: dkorpel at live.nl
There's endless recursion in `syntaxCopy` of an enum member, which copies the
UDA, which copies the enum member etc. So when you instantiate it in a
template:
```
template E()
{
enum E : byte
{
@(1) none
}
}
alias T = E!();
```
```
2.082.1 to 2.092.1: Failure with output:
-----
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function
`_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
-----
Since 2.093.1: Segfault and no output
```
Probably introduced by https://github.com/dlang/dmd/pull/11527 which made the
parser add the enum member to the UDA's `decl` list.
--
More information about the Digitalmars-d-bugs
mailing list