summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fail344.d
blob: f395392a8e7b199e7bb97c514598ef1752ca6049 (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
// https://issues.dlang.org/show_bug.cgi?id=3737
/*
TEST_OUTPUT:
---
fail_compilation/fail344.d(20): Error: undefined identifier `Q`
fail_compilation/fail344.d(20): Error: undefined identifier `Q`
fail_compilation/fail344.d(20): Error: undefined identifier `V`
fail_compilation/fail344.d(23):        while evaluating: `static assert(Alike!(SIB!(crayon)))`
fail_compilation/fail344.d(23): Error: template instance `fail344.SIB!(crayon).SIB.Alike!(SIB!(crayon))` error instantiating
fail_compilation/fail344.d(23):        while evaluating: `static assert(Alike!(SIB!(crayon)))`
fail_compilation/fail344.d(28): Error: template instance `fail344.SIB!(crayon).SIB.opDispatch!"E"` error instantiating
---
*/

int crayon;

struct SIB(alias junk)
{
    template Alike(V) {
        enum bool Alike = Q == V.garbage;
    }
    void opDispatch(string s)() {
        static assert(Alike!(SIB!(crayon)));
    }
}

void main() {
      SIB!(SIB!(crayon).E)(3.0);
}