IDLGenerators: Add register to the list of C++ keywords

This ensures that a generated C++ method called `register` will have an
underscore appended to it, avoiding a compile error.
This commit is contained in:
Tim Ledbetter 2024-08-23 19:53:25 +01:00 committed by Andreas Kling
parent d3e076f963
commit 70fdf7affb
Notes: github-actions[bot] 2024-08-25 10:54:17 +00:00

View File

@ -262,7 +262,7 @@ 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")) {
if (input.is_one_of("class", "template", "for", "default", "char", "namespace", "delete", "inline", "register")) {
StringBuilder builder;
builder.append(input);
builder.append('_');