fix #20686 infer attributes for generated functions

This commit is contained in:
Walter Bright 2025-01-10 23:30:02 -08:00 committed by Nicholas Wilson
parent aa56a318eb
commit 10eb368c1b
3 changed files with 29 additions and 3 deletions

View file

@ -817,4 +817,22 @@ void test13840() nothrow
{}
}
// Add more tests regarding inferences later.
/***************************************************/
// https://github.com/dlang/dmd/pull/20685
struct T1
{
int a;
inout this(ref inout T1 t) @nogc nothrow pure { a = t.a; }
}
struct S1
{
T1 t; // generate copy constructor, infer @nogc nothrow pure
}
void test1() @nogc nothrow pure
{
S1 s;
S1 t = s;
}