mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
29 lines
644 B
D
29 lines
644 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
A: false
|
|
A: false
|
|
fail_compilation/fail7862.d(26): Error: template instance `nonExistent!()` template `nonExistent` is not defined
|
|
fail_compilation/fail7862.d(25): Error: template instance `fail7862.B!(A)` error instantiating
|
|
---
|
|
*/
|
|
|
|
// https://issues.dlang.org/show_bug.cgi?id=7862
|
|
|
|
template B(T) {
|
|
mixin(
|
|
{
|
|
foreach (name; __traits(derivedMembers, T)) {}
|
|
return "struct B {}";
|
|
}()
|
|
);
|
|
}
|
|
|
|
struct A {
|
|
pragma(msg, "A: " ~ (__traits(compiles, B!A) ? "true" : "false"));
|
|
pragma(msg, "A: " ~ (__traits(compiles, B!A) ? "true" : "false"));
|
|
B!A c;
|
|
static if (nonExistent!()) {}
|
|
}
|
|
|
|
auto d = A.init.c;
|