-
Notifications
You must be signed in to change notification settings - Fork 97
Backport src/parser/ to C++17 #2470
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?
Conversation
This commit includes C++17 compatibility fixes for the parser module: - Remove noexcept from copy constructors (not allowed in C++17) - Add static_assert checks for copyable types - Replace emplace_back with push_back where needed for C++17 compatibility - Use std::mem_fn for member function pointers in std::visit - Add necessary backport headers (concepts.h, three_way_comparison.h) - Update CMakeLists.txt to add onlySpatialQuery library - Fix structured binding usage with std::get vs get 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
joka921
left a comment
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.
Some comments.
src/parser/GraphPatternOperation.h
Outdated
| static_assert(ql::concepts::copyable<Optional>); | ||
| static_assert(ql::concepts::copyable<Union>); | ||
| static_assert(ql::concepts::copyable<Subquery>); | ||
| static_assert(ql::concepts::copyable<TransPath>); | ||
| static_assert(ql::concepts::copyable<Bind>); | ||
| static_assert(ql::concepts::copyable<BasicGraphPattern>); | ||
| static_assert(ql::concepts::copyable<Values>); | ||
| static_assert(ql::concepts::copyable<Service>); | ||
| static_assert(ql::concepts::copyable<PathQuery>); | ||
| static_assert(ql::concepts::copyable<SpatialQuery>); | ||
| static_assert(ql::concepts::copyable<TextSearchQuery>); | ||
| static_assert(ql::concepts::copyable<Minus>); | ||
| static_assert(ql::concepts::copyable<GroupGraphPattern>); | ||
| static_assert(ql::concepts::copyable<Describe>); | ||
| static_assert(ql::concepts::copyable<Load>); | ||
| static_assert(ql::concepts::copyable<NamedCachedResult>); |
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.
Those can also go (can easily be reinstated for further stuff).
| MagicServiceQuery() = default; | ||
| MagicServiceQuery(MagicServiceQuery&& other) noexcept = default; | ||
| MagicServiceQuery(const MagicServiceQuery& other) noexcept = default; | ||
| MagicServiceQuery(const MagicServiceQuery& other) = default; |
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 might in fact throw (it is the copy, not the move operation after all), so the older compiler was right to complain about this.
Signed-off-by: Johannes Kalmbach <[email protected]>
ullingerc
left a comment
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.
Looks good
| TripleVec additionalTriples) { | ||
| for (auto&& [predicate, object] : std::move(predicateObjectPairs)) { | ||
| triples.emplace_back(subject, std::move(predicate), std::move(object)); | ||
| triples.push_back({subject, std::move(predicate), std::move(object)}); |
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.
Is emplace back really unsupported in c++17? this surprised me
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.
It is not emplace_back per se, but in combination with aggregates (structs without an explicit constructor):
std::array<int, 3>(4, 5, 6) (with round parentheses) works only in C++20, and the emplace_back is a consequence of this.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2470 +/- ##
==========================================
- Coverage 91.07% 91.07% -0.01%
==========================================
Files 466 466
Lines 39706 39709 +3
Branches 5309 5312 +3
==========================================
Hits 36164 36164
Misses 2034 2034
- Partials 1508 1511 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Johannes Kalmbach <[email protected]>
Overview
Conformance check passed ✅No test result changes. |
|



This commit includes C++17 compatibility fixes for the parser module:
🤖 Generated with Claude Code