d: Merge upstream dmd 47871363d, druntime, c52e28b7, phobos 99e9c1b77.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail7862.d
blob08e6f6930c0bf318ae16b2d190e4d6c373c6c09a
1 /*
2 TEST_OUTPUT:
3 ---
4 A: false
5 A: false
6 fail_compilation/fail7862.d(26): Error: template instance `nonExistent!()` template `nonExistent` is not defined
7 fail_compilation/fail7862.d(25): Error: template instance `fail7862.B!(A)` error instantiating
8 ---
9 */
11 // https://issues.dlang.org/show_bug.cgi?id=7862
13 template B(T) {
14 mixin(
16 foreach (name; __traits(derivedMembers, T)) {}
17 return "struct B {}";
18 }()
22 struct A {
23 pragma(msg, "A: " ~ (__traits(compiles, B!A) ? "true" : "false"));
24 pragma(msg, "A: " ~ (__traits(compiles, B!A) ? "true" : "false"));
25 B!A c;
26 static if (nonExistent!()) {}
29 auto d = A.init.c;