diff options
| author | gingerBill <bill@gingerbill.org> | 2020-03-26 15:56:08 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-03-26 15:56:08 +0000 |
| commit | 7909872877fd5c82c29df711f160838a7a4e59e1 (patch) | |
| tree | 64184c011253bf986bc48333ad3344f2f6d4abfc /src/check_expr.cpp | |
| parent | 0a920b5439a66c08dedd4bfbef76223bd8fb8a13 (diff) | |
Allow referencing a compound literal to act like C99
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 8df9c8b88..4fdffcaa3 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -1653,6 +1653,11 @@ bool check_is_not_addressable(CheckerContext *c, Operand *o) { return false; } + Ast *expr = unparen_expr(o->expr); + if (expr->kind == Ast_CompoundLit) { + return false; + } + if (o->mode != Addressing_Variable) { return true; } |