diff --git a/scripts/cxx-api/parser/builders.py b/scripts/cxx-api/parser/builders.py index c595183d86c..beb9be1c51c 100644 --- a/scripts/cxx-api/parser/builders.py +++ b/scripts/cxx-api/parser/builders.py @@ -333,6 +333,8 @@ def get_doxygen_params( + param_array ) param_name = None + elif param_name: + param_name += param_array else: param_type += param_array diff --git a/scripts/cxx-api/tests/snapshots/should_handle_array_syntax_correctly/snapshot.api b/scripts/cxx-api/tests/snapshots/should_handle_array_syntax_correctly/snapshot.api new file mode 100644 index 00000000000..d0f9dd2bf87 --- /dev/null +++ b/scripts/cxx-api/tests/snapshots/should_handle_array_syntax_correctly/snapshot.api @@ -0,0 +1,3 @@ +void test::arrayParam(const char name[]); +void test::arrayParamSized(int values[10]); +void test::arrayParamUnnamed(const char[]); diff --git a/scripts/cxx-api/tests/snapshots/should_handle_array_syntax_correctly/test.h b/scripts/cxx-api/tests/snapshots/should_handle_array_syntax_correctly/test.h new file mode 100644 index 00000000000..43240dd86f0 --- /dev/null +++ b/scripts/cxx-api/tests/snapshots/should_handle_array_syntax_correctly/test.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +namespace test { + +void arrayParam(const char name[]); +void arrayParamSized(int values[10]); +void arrayParamUnnamed(const char[]); + +} // namespace test