summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/constraints_func3.d
blob: f0a5099358f168d7964e00ef5f0e5f40c0e5cb28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
EXTRA_FILES: imports/constraints.d
TEST_OUTPUT:
---
fail_compilation/constraints_func3.d(53): Error: template `imports.constraints.overload` cannot deduce function from argument types `!()(int)`
fail_compilation/imports/constraints.d(39):        Candidates are: `overload(T)(T v)`
  with `T = int`
  must satisfy the following constraint:
`       N!T`
fail_compilation/imports/constraints.d(40):                        `overload(T)(T v)`
  with `T = int`
  must satisfy the following constraint:
`       !P!T`
fail_compilation/imports/constraints.d(41):                        `overload(T)(T v1, T v2)`
fail_compilation/imports/constraints.d(42):                        `overload(T, V)(T v1, V v2)`
fail_compilation/constraints_func3.d(54): Error: template `imports.constraints.overload` cannot deduce function from argument types `!()(int, string)`
fail_compilation/imports/constraints.d(39):        Candidates are: `overload(T)(T v)`
fail_compilation/imports/constraints.d(40):                        `overload(T)(T v)`
fail_compilation/imports/constraints.d(41):                        `overload(T)(T v1, T v2)`
fail_compilation/imports/constraints.d(42):                        `overload(T, V)(T v1, V v2)`
  with `T = int,
       V = string`
  must satisfy one of the following constraints:
`       N!T
       N!V`
fail_compilation/constraints_func3.d(56): Error: template `imports.constraints.variadic` cannot deduce function from argument types `!()()`
fail_compilation/imports/constraints.d(43):        Candidate is: `variadic(A, T...)(A a, T v)`
fail_compilation/constraints_func3.d(57): Error: template `imports.constraints.variadic` cannot deduce function from argument types `!()(int)`
fail_compilation/imports/constraints.d(43):        Candidate is: `variadic(A, T...)(A a, T v)`
  with `A = int,
       T = ()`
  must satisfy the following constraint:
`       N!int`
fail_compilation/constraints_func3.d(58): Error: template `imports.constraints.variadic` cannot deduce function from argument types `!()(int, int)`
fail_compilation/imports/constraints.d(43):        Candidate is: `variadic(A, T...)(A a, T v)`
  with `A = int,
       T = (int)`
  must satisfy the following constraint:
`       N!int`
fail_compilation/constraints_func3.d(59): Error: template `imports.constraints.variadic` cannot deduce function from argument types `!()(int, int, int)`
fail_compilation/imports/constraints.d(43):        Candidate is: `variadic(A, T...)(A a, T v)`
  with `A = int,
       T = (int, int)`
  must satisfy the following constraint:
`       N!int`
---
*/

void main()
{
    import imports.constraints;

    overload(0);
    overload(0, "");

    variadic();
    variadic(0);
    variadic(0, 1);
    variadic(0, 1, 2);
}