Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cppinterop-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Check out CppInterOp
uses: actions/checkout@v6
with:
repository: compiler-research/CppInterOp
repository: root-project/CppInterOp
ref: ${{ steps.determine-tag.outputs.tag }}
path: CppInterOp
- name: Drop directories that are not added to ROOT
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cppjit-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Check out cppjit
uses: actions/checkout@v6
with:
repository: compiler-research/cppjit
repository: root-project/cppjit
ref: ${{ steps.determine-tag.outputs.tag }}
path: cppjit
- name: Drop files that are not added to ROOT
Expand Down
2 changes: 1 addition & 1 deletion bindings/pyroot/cppjit/cppjit-version.tag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3c66389821de2084c69cc9fdfcd26e32b47e16f5
ROOT-20261117-01
11 changes: 11 additions & 0 deletions bindings/pyroot/cppjit/src/interop/interop_wrapper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,17 @@ interop::TCppScope_t interop::GetNamed(const std::string& name,
if (TCppScope_t named = Cpp::GetNamed(name, parent_scope))
return named;

// Rootmaps don't forward declare enums and variables. If TClass::GetClass
// looked one up before its header was parsed, clang cached that miss and
// won't ask TCling to autoparse it again (#24176).
if (parent_scope && Cpp::IsNamespace(parent_scope)) {
const std::string qualified_name =
Cpp::GetQualifiedCompleteName(parent_scope) + "::" + name;
if (gInterpreter->AutoParse(qualified_name.c_str()))
if (TCppScope_t named = Cpp::GetNamed(name, parent_scope))
return named;
}

// "gROOT" is a macro expanding to ROOT::GetROOT(); ROOT master exposed it
// to cppyy as a TGlobalMappedFunction, a mechanism this backend does not
// consult. Resolve it to the underlying variable instead (making sure it
Expand Down
2 changes: 1 addition & 1 deletion interpreter/CppInterOp/cppinterop-version.tag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
acfde2400bedb9a243106c7ec868d3b2e29a8d03
ROOT-20261021-01
15 changes: 15 additions & 0 deletions roottest/python/regression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,19 @@ endif()

ROOTTEST_ADD_TEST(gh_21536
MACRO gh_21536.py)

ROOTTEST_GENERATE_REFLEX_DICTIONARY(gh_24176
gh_24176.h
SELECTION gh_24176_selection.xml
FIXTURES_SETUP python-regression-gh_24176-dict-fixture)

ROOTTEST_ADD_TEST(gh_24176_enum
MACRO gh_24176.py
OPTS enum
FIXTURES_REQUIRED python-regression-gh_24176-dict-fixture)

ROOTTEST_ADD_TEST(gh_24176_variable
MACRO gh_24176.py
OPTS variable
FIXTURES_REQUIRED python-regression-gh_24176-dict-fixture)
endif()
18 changes: 18 additions & 0 deletions roottest/python/regression/gh_24176.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef GH_24176_H
#define GH_24176_H

// Rootmaps don't forward declare enums and variables.
namespace gh_24176 {
namespace ns {

enum EnumInNamespace {
kFirst = 1,
kSecond = 2
};

const int kConstant = 3;

} // namespace ns
} // namespace gh_24176

#endif
20 changes: 20 additions & 0 deletions roottest/python/regression/gh_24176.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Regression test for https://github.com/root-project/root/issues/24176
#
# The names are only known from the rootmap, and finding them requires parsing
# their header. The first lookup parses the whole header, so each kind of name
# is checked in its own process.

import sys

kind = sys.argv[-1]

if kind == "enum":
from ROOT.gh_24176.ns import EnumInNamespace

assert EnumInNamespace.kSecond == 2
elif kind == "variable":
from ROOT.gh_24176.ns import kConstant

assert kConstant == 3
else:
raise ValueError(f"unknown kind {kind!r}")
4 changes: 4 additions & 0 deletions roottest/python/regression/gh_24176_selection.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<lcgdict>
<enum pattern="gh_24176::ns::*" />
<variable pattern="gh_24176::ns::*" />
</lcgdict>
Loading