From f727f3ccb117da433c67defaa3f6dd94f51b403d Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sun, 5 May 2024 00:12:11 -0400 Subject: [PATCH] codegen/gen_src.cpp fixes for building with metaprogram clang --- codegen/gen_src.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codegen/gen_src.cpp b/codegen/gen_src.cpp index e2095c688..ce9cd5556 100644 --- a/codegen/gen_src.cpp +++ b/codegen/gen_src.cpp @@ -1,3 +1,5 @@ +#pragma clang diagnostic ignored "-Wswitch" + #define GEN_DEFINE_LIBRARY_CODE_CONSTANTS #define GEN_ENFORCE_STRING_CODE_TYPES #define GEN_EXPOSE_BACKEND @@ -246,9 +248,10 @@ int gen_main() { CodeStruct code_struct = code.cast(); if (code->Name.starts_with(txt("Ast"))) - for (Code ast_code : code_struct->Body) switch (ast_code->Type) + for (Code ast_code : code_struct->Body) switch (ast_code->Type) { case ECode::Union: + { // Swap out the union's contents with the generated member definitions CodeBody body_swap = def_body(ECode::Union_Body); for (Odin_AstKind kind : ast_kinds) @@ -256,6 +259,7 @@ int gen_main() Ast ; )))); ast_code->Body = rcast(AST*, body_swap.ast); + } break; default: continue;