summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/ice14907.d
blob: ac4ba68a85865ea9726605a73fc6e2cd74627a4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
TEST_OUTPUT:
---
fail_compilation/ice14907.d(14): Error: struct `ice14907.S(int v = S)` recursive template expansion
fail_compilation/ice14907.d(19):        while looking for match for `S!()`
fail_compilation/ice14907.d(15): Error: template `ice14907.f(int v = f)()` recursive template expansion
fail_compilation/ice14907.d(20):        while looking for match for `f!()`
fail_compilation/ice14907.d(15): Error: template `ice14907.f(int v = f)()` recursive template expansion
fail_compilation/ice14907.d(21): Error: template `ice14907.f` cannot deduce function from argument types `!()()`
fail_compilation/ice14907.d(15):        Candidate is: `f(int v = f)()`
---
*/

struct S(int v = S) {}
void f(int v = f)() {}

void main()
{
    S!() s;     // OK <- ICE
    f!()();     // OK <- ICE
    f();        // OK <- ICE
}