Ignore anonymous variables in the snapshot (#55845)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55845

Changelog: [Internal]

Updates C++ API snapshot generator not to include anonymous variables in the snapshot.

This covers an edge case where doxygen will generate an anonymout member of type "union" when an anonymous union is present in a class.

Reviewed By: cipolleschi

Differential Revision: D94901506

fbshipit-source-id: cb02b3b80389fcf5a0ac20012e0897afc355cb57
This commit is contained in:
Jakub Piasecki authored and meta-codesync[bot] committed 2026-03-03 01:00:16 -08:00
1 parent 25ac11b03d
commit 44bb931446
3 files changed
+31

No files matched your search

+4
View File
@@ -479,6 +479,10 @@ def build_snapshot(xml_dir: str) -> Snapshot:
member_def.get_type()
)
# Skip anonymous variables
if "@" in var_type:
continue
if var_type == "friend":
class_scope.add_member(
FriendMember(
@@ -0,0 +1,5 @@
struct test::BundleHeader {
public uint32_t magic32;
public uint32_t version;
public uint64_t magic64;
}
@@ -0,0 +1,22 @@
/*
* 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
#include <cstdint>
namespace test {
struct BundleHeader {
union {
uint32_t magic32;
uint64_t magic64;
};
uint32_t version;
};
} // namespace test