Ignore anonymous namespaces in the snapshot (#55844)

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

Changelog: [Internal]

Updates the C++ API snapshot generator not to include anonymous namespaces in the snapshot since those have internal linkage.

Reviewed By: cipolleschi

Differential Revision: D94901508

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

No files matched your search

+5
View File
@@ -526,6 +526,11 @@ def build_snapshot(xml_dir: str) -> Snapshot:
f"Unknown class visibility: {visibility} in {compound_object.location.file}"
)
elif compound_object.kind == "namespace":
# Skip anonymous namespaces (internal linkage, not public API).
# Doxygen encodes them with a '@' prefix in the compound name.
if "@" in compound_object.compoundname:
continue
namespace_scope = snapshot.create_or_get_namespace(
compound_object.compoundname
)
@@ -0,0 +1,3 @@
class test::Clss {
public void hello();
}
@@ -0,0 +1,24 @@
/*
* 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 {
enum class InternalEnum {
A,
B,
};
} // namespace
namespace test {
class Clss {
public:
void hello();
};
} // namespace test