-
Notifications
You must be signed in to change notification settings - Fork 6
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
base: master
Are you sure you want to change the base?
Syncup wlav #155
Conversation
…ena volatility, e.g. by the default compiler) from wlav@777f55e
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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
if cppyy.gbl.gInterpreter.ProcessLine("__cplusplus;") <= 201402: | ||
# string_view exists as of C++17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
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>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#if __has_include(<span>) | |
#if __cplusplus >= 202002 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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?
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" |
Hi @aaronj0, I guess you forgot to sync the |
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