mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
21 lines
542 B
D
21 lines
542 B
D
// REQUIRED_ARGS: -w
|
|
// https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
|
|
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail4375p.d(19): Warning: else is dangling, add { } after condition at fail_compilation/fail4375p.d(12)
|
|
fail_compilation/fail4375p.d(16): Error: undefined identifier `x`
|
|
---
|
|
*/
|
|
|
|
void main() {
|
|
if (true)
|
|
while (false)
|
|
for (;;)
|
|
scope (exit)
|
|
synchronized (x)
|
|
if (true)
|
|
assert(90);
|
|
else
|
|
assert(89);
|
|
}
|