From 3ca879776f61cf4e853569b191d50cab7f5050ea Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 23 Apr 2025 12:04:09 +0100 Subject: [PATCH] IDLGenerators: Allow `initialize()` as an IDL member name While not a C++ keyword, we already define a `Foo::initialize()` method on every generated binding type, so we need to avoid clashing with that. --- .../LibWeb/BindingsGenerator/IDLGenerators.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 77fd065e818..06d0952331d 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -324,7 +324,20 @@ CppType idl_type_name_to_cpp_type(Type const& type, Interface const& interface) static ByteString make_input_acceptable_cpp(ByteString const& input) { - if (input.is_one_of("class", "template", "for", "default", "char", "namespace", "delete", "inline", "register", "switch", "mutable", "continue")) { + if (input.is_one_of( + "char", + "class", + "continue", + "default", + "delete", + "for", + "initialize", + "inline", + "mutable", + "namespace", + "register", + "switch", + "template")) { StringBuilder builder; builder.append(input); builder.append('_');