Fix bypassing nothrow in debug statements (#20720)

* Fix bypassing nothrow in debug statements

* Fix debug walking null statements
This commit is contained in:
Dennis 2025-01-17 01:50:17 +01:00 committed by GitHub
parent b237d0329c
commit ac9e8a5a70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 19 deletions

View file

@ -85,3 +85,17 @@ void test6() nothrow
() {throw new Exception("");}();
}
}
void writeln() {}
void writeln(string) {}
void test7() nothrow
{
debug writeln("Hello"); // https://issues.dlang.org/show_bug.cgi?id=24017
debug "Hello".writeln;
debug writeln = "Hello"; // https://github.com/dlang/dmd/issues/20719
debug writeln;
// https://github.com/dlang/dmd/pull/20720#issuecomment-2596892489
debug pragma(msg, ""); // Came up as segfault, pragma statement became null after semantic
}

View file

@ -1,11 +0,0 @@
// https://issues.dlang.org/show_bug.cgi?id=24017
// REQUIRED_ARGS: -debug
void writeln(string) {}
void main() nothrow
{
debug writeln("Hello");
debug "Hello".writeln;
}