Skip to content

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 1374
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...

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?

@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.

@aaronj0 aaronj0 changed the title Syncup wlav Syncup with wlav/cppyy Sep 4, 2025
This part of the test was performed incorrectly, the for loop uses j, and the value of i fixes the comparison to `short` only and ignores the other types; This caused the test to pass by chance.
This has been rewritten with an outer loop that goes over the different type names (name) and j that iterates over the array indices.

The values of `alpha` were also incorrect and did not reflect the multiplier used in the test dictionary.

Another point to note is in the case of signed char, the pointer `m_schar_array2` is implicitly converted to `std::basic_string` while the fixed size array `m_schar_array` is not. Using the getter `get_schar_array2` however works here and we only compare using the instance retrieved this way and skip comparing `c.m_schar_array2` for this reason.
Copy link
Collaborator

@Vipul-Cariappa Vipul-Cariappa left a comment

Choose a reason for hiding this comment

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

LGTM! ;)

@aaronj0 aaronj0 merged commit bb29a9b into compiler-research:master Sep 8, 2025
46 checks passed
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