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

@mustuse struct S {}

S fun() { return S(); }
void sideEffect() {}

void test()
{
    (fun(), sideEffect());
}