summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fail19103.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/fail_compilation/fail19103.d')
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/fail19103.d36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail19103.d b/gcc/testsuite/gdc.test/fail_compilation/fail19103.d
new file mode 100644
index 00000000000..6b740ac6945
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail19103.d
@@ -0,0 +1,36 @@
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail19103.d(12): Error: no property `puts` for type `fail19103.C`
+fail_compilation/fail19103.d(14): Error: no property `puts` for type `fail19103.S1`
+fail_compilation/fail19103.d(16): Error: no property `puts` for type `S2`, did you mean `core.stdc.stdio.puts`?
+---
+*/
+
+void main()
+{
+ (new C).puts("OK."); // Error: no property puts for type test.C, did you mean core.stdc.stdio.puts(T...)(T args)?
+ S1 s1;
+ s1.puts("Hey?"); // It can be compiled and runs!
+ S2 s2;
+ s2.puts("OK."); // Error: no property puts for type S2, did you mean core.stdc.stdio.puts(T...)(T args)?
+}
+
+mixin template T()
+{
+ import core.stdc.stdio;
+}
+
+class C
+{
+ mixin T;
+}
+struct S1
+{
+ mixin T;
+}
+
+struct S2
+{
+ import core.stdc.stdio;
+}