mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
Fix 23386 - Segfault on enum member UDA inside template (#14522)
This commit is contained in:
parent
a9ae71196b
commit
9ceae92890
2 changed files with 13 additions and 3 deletions
|
@ -3168,9 +3168,7 @@ class Parser(AST, Lexer = dmd.lexer.Lexer) : Lexer
|
|||
|
||||
if (udas)
|
||||
{
|
||||
auto s = new AST.Dsymbols();
|
||||
s.push(em);
|
||||
auto uad = new AST.UserAttributeDeclaration(udas, s);
|
||||
auto uad = new AST.UserAttributeDeclaration(udas, new AST.Dsymbols());
|
||||
em.userAttribDecl = uad;
|
||||
}
|
||||
|
||||
|
|
12
compiler/test/compilable/test23386.d
Normal file
12
compiler/test/compilable/test23386.d
Normal file
|
@ -0,0 +1,12 @@
|
|||
// https://issues.dlang.org/show_bug.cgi?id=23386
|
||||
// Segfault on enum member UDA inside template
|
||||
|
||||
template E()
|
||||
{
|
||||
enum E : byte
|
||||
{
|
||||
@(1) none,
|
||||
}
|
||||
}
|
||||
|
||||
alias T = E!();
|
Loading…
Add table
Add a link
Reference in a new issue