summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/compilable/test21831.d
blob: aaae1356cb8e7ee582e604ac08e85e270b4d5034 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// REQUIRED_ARGS: -de -unittest

deprecated struct S21831 { }

auto test21831(T)(T t)    // error: struct `S21831` is deprecated
if (!__traits(isDeprecated, T))
{
    return T.init;
}

deprecated auto test21831(T)(T t)
if (__traits(isDeprecated, T))
{
    return T.init;
}

deprecated unittest
{
    auto b = test21831(S21831()); // instantiated from here
}