MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail20609.d
blob80a5d4615741e15e411b3c8fbd93de8569d16f84
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail20609.d(26): Error: none of the overloads of `this` are callable using argument types `(int)`
5 fail_compilation/fail20609.d(23): Candidate is: `fail20609.Foo.this(string[] args)`
6 fail_compilation/fail20609.d(27): Error: none of the overloads of `this` are callable using argument types `(int)`
7 fail_compilation/fail20609.d(22): Candidates are: `fail20609.Foo.this(Object __param_0)`
8 fail_compilation/fail20609.d(23): `fail20609.Foo.this(string[] args)`
9 fail_compilation/fail20609.d(37): Error: none of the overloads of `this` are callable using argument types `(int)`
10 fail_compilation/fail20609.d(37): All possible candidates are marked as `deprecated` or `@disable`
11 fail_compilation/fail20609.d(43): Error: undefined identifier `deprecatedTypo_`
12 fail_compilation/fail20609.d(44): Error: undefined identifier `deprecatedTypo_`, did you mean function `deprecatedTypo`?
13 fail_compilation/fail20609.d(45): Error: undefined identifier `disabledTypo_`
14 ---
17 // Only show `this(string[])` in non-deprecated context.
18 // Show both `this(string[])` and ` this(Object)` in deprecated context.
19 struct Foo
21 @disable this();
22 deprecated this(Object) {}
23 this(string[] args) {}
26 void test1() { auto f = Foo(42); }
27 deprecated void test2() { auto f = Foo(42); }
29 // Make sure we do not show a message promising candidates,
30 // then no candidates in the special case where nothing
31 // would be usable
32 struct WhoDoesThat
34 @disable this();
35 deprecated this(Object) {}
37 void test3() { auto f = WhoDoesThat(42); }
39 // Make sure we don't suggest disabled or deprecated functions
40 deprecated void deprecatedTypo () {}
41 @disable void disabledTypo () {}
43 void test4 () { deprecatedTypo_("42"); }
44 deprecated void test5 () { deprecatedTypo_("42"); }
45 void test6 () { disabledTypo_("42"); }