From 7909872877fd5c82c29df711f160838a7a4e59e1 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 26 Mar 2020 15:56:08 +0000 Subject: Allow referencing a compound literal to act like C99 --- src/check_expr.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/check_expr.cpp') 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; } -- cgit v1.2.3