aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-06-26 17:06:42 +0100
committergingerBill <bill@gingerbill.org>2023-06-26 17:06:42 +0100
commitcdcb64b0d08be85c3ea579270eeb4d193b4cb495 (patch)
tree64dd61e91871bdabb26acdaa54d3883fe9385820 /src/check_expr.cpp
parent3c0f1caa41e758e5568ed4d32b3f8951548c8672 (diff)
Add missing `-strict-style` check
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index b12c6d114..7b3ddfc73 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -2247,6 +2247,10 @@ gb_internal bool check_is_not_addressable(CheckerContext *c, Operand *o) {
}
gb_internal void check_old_for_or_switch_value_usage(Ast *expr) {
+ if (!build_context.strict_style) {
+ return;
+ }
+
Entity *e = entity_of_node(expr);
if (e != nullptr && (e->flags & EntityFlag_OldForOrSwitchValue) != 0) {
GB_ASSERT(e->kind == Entity_Variable);