summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/ice15922.d
blob: d98404ca34a6f90b7f23636dd596f6f80d0ca994 (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
/*
TEST_OUTPUT:
---
fail_compilation/ice15922.d(23): Error: function `ice15922.ValidSparseDataStore!int.ValidSparseDataStore.correctedInsert!false.correctedInsert` has no `return` statement, but is expected to return a value of type `int`
fail_compilation/ice15922.d(21): Error: template instance `ice15922.ValidSparseDataStore!int.ValidSparseDataStore.correctedInsert!false` error instantiating
fail_compilation/ice15922.d(26):        instantiated from here: `ValidSparseDataStore!int`
fail_compilation/ice15922.d(14): Error: need `this` for `insert` of type `pure nothrow @nogc @safe int()`
fail_compilation/ice15922.d(26): Error: template instance `ice15922.StorageAttributes!(ValidSparseDataStore!int)` error instantiating
---
*/

template StorageAttributes(Store)
{
    enum hasInsertMethod = Store.insert;
    enum hasFullSlice = Store.init[];
}
struct ValidSparseDataStore(DataT)
{
    DataT insert()
    {
        correctedInsert!(false);
    }
    DataT correctedInsert(bool CorrectParents)() {}
    auto opSlice() inout {}
}
alias BasicCubeT = StorageAttributes!(ValidSparseDataStore!int);