Open Byter09 opened 4 years ago
$ run_clang
union u2 u2a;
unions()
{
u2a ;
}
<stdin>:3:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
unions()
^
<stdin>:5:5: error: incomplete type 'union u2' where a complete type is required
u2a ;
^
<stdin>:1:7: note: forward declaration of 'union u2'
union u2 u2a;
^
<stdin>:5:5: warning: expression result unused [-Wunused-value]
u2a ;
^~~
<stdin>:1:10: error: tentative definition has type 'union u2' that is never completed
union u2 u2a;
^
<stdin>:1:7: note: forward declaration of 'union u2'
union u2 u2a;
^
2 warnings and 2 errors generated.
Code
Expected behavior
Not really a C expert so I have no clue :)
Backtrace
``` The application panicked (crashed). Message: bug in parser: loaded a variable that was not declared Location: /storage/saltwater/src/ir/expr.rs:417 Run with RUST_BACKTRACE=full to include source snippets. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ⋮ 4 frames hidden ⋮ 5: core::panicking::panic_fmt::h1ac71ad045d55416 at src/libcore/panicking.rs:111 6: core::option::expect_failed::h7baa1c60813ff0e3 at src/libcore/option.rs:1260 7: core::option::Option