Skip to content

Syncup wlav #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Syncup wlav #155

wants to merge 17 commits into from

Conversation

aaronj0
Copy link
Collaborator

@aaronj0 aaronj0 commented Aug 1, 2025

This PR brings our cppyy frontend up to date with wlav/cppyy:

Introduces all new tests (up to 540)
Adds new functions to the frontend (macro, as_memoryview)
Updates dictionaries for the same

Requires updating test tags based on CI results

Comment on lines +1355 to +1366
def test45_typedef_resolution(self):
"""Typedefs starting with 'c'"""

import cppyy

cppyy.cppdef("""\
typedef const int my_custom_type_t;
typedef const int cmy_custom_type_t;
""")

assert cppyy.gbl.CppyyLegacy.TClassEdit.ResolveTypedef("my_custom_type_t") == "const int"
assert cppyy.gbl.CppyyLegacy.TClassEdit.ResolveTypedef("cmy_custom_type_t") == "const int"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test does not make sense with our fork.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to rework it and fix it upstream, too...

Comment on lines +1722 to +1723
if cppyy.gbl.gInterpreter.ProcessLine("__cplusplus;") <= 201402:
# string_view exists as of C++17
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if cppyy.gbl.gInterpreter.ProcessLine("__cplusplus;") <= 201402:
# string_view exists as of C++17
if cppyy.gbl.Cpp.Evaluate("__cplusplus") <= 201402:
# string_view exists as of C++17

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable fix.

import cppyy

cppyy.cppdef("""\
#if __has_include(<span>)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if __has_include(<span>)
#if __cplusplus >= 202002

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this instead of the has_include?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at https://godbolt.org/z/6E8v4vooo with and without the -std=c++20.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Can you make sure this is updated upstream too?

Comment on lines +1360 to +1366
cppyy.cppdef("""\
typedef const int my_custom_type_t;
typedef const int cmy_custom_type_t;
""")

assert cppyy.gbl.CppyyLegacy.TClassEdit.ResolveTypedef("my_custom_type_t") == "const int"
assert cppyy.gbl.CppyyLegacy.TClassEdit.ResolveTypedef("cmy_custom_type_t") == "const int"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cppyy.cppdef("""\
typedef const int my_custom_type_t;
typedef const int cmy_custom_type_t;
""")
assert cppyy.gbl.CppyyLegacy.TClassEdit.ResolveTypedef("my_custom_type_t") == "const int"
assert cppyy.gbl.CppyyLegacy.TClassEdit.ResolveTypedef("cmy_custom_type_t") == "const int"
cppyy.cppdef("""\
namespace Cppyy {
std::string ResolveName(const std::string& name);
}
typedef const int my_custom_type_t;
typedef const int cmy_custom_type_t;
""")
assert cppyy.gbl.Cppyy.ResolveName("my_custom_type_t") == "const int"
assert cppyy.gbl.Cppyy.ResolveName("cmy_custom_type_t") == "const int"

@Vipul-Cariappa
Copy link
Collaborator

Hi @aaronj0, I guess you forgot to sync the numba_ext.py file. Doing so will enable some of the numba tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants