summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fail18620.d
blob: ce202b8846463ae6dceb462abc5974ea788f8c77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
TEST_OUTPUT:
---
fail_compilation/fail18620.d(14): Error: `strlen` cannot be interpreted at compile time, because it has no available source code
fail_compilation/fail18620.d(19):        compile time context created here
fail_compilation/fail18620.d(14): Error: `strlen` cannot be interpreted at compile time, because it has no available source code
fail_compilation/fail18620.d(20):        compile time context created here
---
*/
class A{
    this(const(char)* s)
    {
        import core.stdc.string;
        auto a=strlen(s);
    }
}

void main(){
    static a = new A("a");
    __gshared b = new A("b");
}