summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/must_use.d
blob: e3b5fedfd4d79ce44b822f97c04215f18b689e77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/+
TEST_OUTPUT:
---
fail_compilation/must_use.d(15): Error: ignored value of `@mustuse` type `must_use.S`; prepend a `cast(void)` if intentional
---
+/
import core.attribute;

@mustuse struct S {}

S fun() { return S(); }

void test()
{
    fun();
}