diff options
Diffstat (limited to 'gcc/testsuite/gdc.test/compilable/must_use_opassign.d')
-rw-r--r-- | gcc/testsuite/gdc.test/compilable/must_use_opassign.d | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/compilable/must_use_opassign.d b/gcc/testsuite/gdc.test/compilable/must_use_opassign.d new file mode 100644 index 00000000000..8e877dd69b6 --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/must_use_opassign.d @@ -0,0 +1,15 @@ +import core.attribute; + +@mustuse struct S +{ + ref S opAssign(S rhs) return + { + return this; + } +} + +void test() +{ + S a, b; + a = b; +} |