mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 05:30:13 +03:00
fix #20686 infer attributes for generated functions
This commit is contained in:
parent
aa56a318eb
commit
10eb368c1b
3 changed files with 29 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue