summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/compilable/test20653.d
blob: c7f329d777fb93cb8aee7530f42ac67c1cf21d8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// LINK:
enum x = 10;
enum Thing { A, B }
enum IsThing(T) = is(T == enum) || (__traits(getLinkage, T) == "C++");
enum Is = IsThing!Thing;

static assert(Is);

enum Another(T) = is(T == int) && (__traits(getLinkage, T) == "C++");

static assert(!Another!Thing);

T myFunc(T)() { return T.init; }
enum Foo(T) = is(T == int) || myFunc!T();

void main ()
{
    assert(myFunc!int() == 0);
}