-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add GetEnumConstantDatamembers
function
#499
Add GetEnumConstantDatamembers
function
#499
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #499 +/- ##
==========================================
+ Coverage 71.17% 71.26% +0.09%
==========================================
Files 9 9
Lines 3552 3564 +12
==========================================
+ Hits 2528 2540 +12
Misses 1024 1024
|
clang-tidy review says "All clean, LGTM! 👍" |
b35b261
to
791cd18
Compare
clang-tidy review says "All clean, LGTM! 👍" |
lib/Interpreter/CppInterOp.cpp
Outdated
auto* ED = static_cast<EnumDecl*>(i); | ||
|
||
bool is_class_tagged = ED->isScopedUsingClassTag(); | ||
if ((is_class_tagged) && !(is_class_tagged && include_class_enum)) |
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 ((is_class_tagged) && !(is_class_tagged && include_class_enum)) | |
if (is_class_tagged || !include_class_enum) |
Isn't that what you mean? Only include scoped enums when the user requested?
lib/Interpreter/CppInterOp.cpp
Outdated
for (auto iterator = ED->enumerator_begin(); | ||
iterator != ED->enumerator_end(); iterator++) | ||
datamembers.push_back(*iterator); |
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.
for (auto iterator = ED->enumerator_begin(); | |
iterator != ED->enumerator_end(); iterator++) | |
datamembers.push_back(*iterator); | |
std::copy(ED->enumerator_begin(), ED->enumerator_end(), std::back_inserter(dm)); |
791cd18
to
8e44ab8
Compare
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.
clang-tidy made some suggestions
if (is_class_tagged && !include_enum_class) | ||
continue; | ||
|
||
std::copy(ED->enumerator_begin(), ED->enumerator_end(), |
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.
warning: no header providing "std::copy" is directly included [misc-include-cleaner]
lib/Interpreter/CppInterOp.cpp:26:
- #if CLANG_VERSION_MAJOR >= 19
+ #include <algorithm>
+ #if CLANG_VERSION_MAJOR >= 19
continue; | ||
|
||
std::copy(ED->enumerator_begin(), ED->enumerator_end(), | ||
std::back_inserter(datamembers)); |
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.
warning: no header providing "std::back_inserter" is directly included [misc-include-cleaner]
lib/Interpreter/CppInterOp.cpp:26:
- #if CLANG_VERSION_MAJOR >= 19
+ #include <iterator>
+ #if CLANG_VERSION_MAJOR >= 19
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.
These are good suggestions...
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.
resolved.
to resolve all `EnumConstantDecl`s declared in a class
8e44ab8
to
97c8602
Compare
clang-tidy review says "All clean, LGTM! 👍" |
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.
Lgtm!
Resolve all
EnumConstantDecl
s declared in a class.Fixes # (issue)
1 test at cppyy.
Please tick all options which are relevant.
Testing
Implemented tests.
Checklist