Skip to content

Commit

Permalink
translate-c: allow str literals in bool expressions
Browse files Browse the repository at this point in the history
this is a follow up to ziglang#19610 with fix suggested by Vexu in
ziglang#14642 (comment)
  • Loading branch information
travisstaloch authored Apr 12, 2024
1 parent 07b17e8 commit a0914e9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions translate_c/strlit_as_bool.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
void foo() { if(0 && "error message") {} }

// translate-c
// c_frontend=clang
//
// pub export fn foo() void {
// if (false and (@intFromPtr("error message") != 0)) {}
// }

0 comments on commit a0914e9

Please sign in to comment.