From f341bb0522e73d5cb033a43197db7e05561d5f54 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Tue, 22 Apr 2025 11:16:19 +0200 Subject: [PATCH] IDLGenerators: Cast wrapped references to a known reference type They may be GC::Ref objects, which should be converted to T const& before being so nicely const-cast to T&. --- .../CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index bf4ea033228..f180c8fdb24 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -2074,7 +2074,7 @@ static void generate_wrap_statement(SourceGenerator& generator, ByteString const )~~~"); } else { scoped_generator.append(R"~~~( - @result_expression@ &const_cast<@type@&>(@value@); + @result_expression@ &const_cast<@type@&>(static_cast<@type@ const&>(@value@)); )~~~"); } }