Fix 23386 - Segfault on enum member UDA inside template (#14522)

This commit is contained in:
Dennis 2022-10-05 04:05:18 +02:00 committed by GitHub
parent a9ae71196b
commit 9ceae92890
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View file

@ -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;
}

View 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!();