fix: ST_Distance_Sphere::BindData::Copy std::move for GCC 11+#795
Open
pierre-warnier wants to merge 1 commit intoduckdb:v1.5-variegatafrom
Open
fix: ST_Distance_Sphere::BindData::Copy std::move for GCC 11+#795pierre-warnier wants to merge 1 commit intoduckdb:v1.5-variegatafrom
pierre-warnier wants to merge 1 commit intoduckdb:v1.5-variegatafrom
Conversation
The Copy() method returns a unique_ptr<BindData> which must be converted to unique_ptr<FunctionData>. Under GCC 11+ this conversion requires explicit std::move() — newer compilers reject the implicit conversion as a copy-initialization. Fixes: error: could not convert 'copy' from 'unique_ptr<ST_Distance_Sphere::BindData>' to 'unique_ptr<FunctionData>'
This was referenced Apr 15, 2026
There was a problem hiding this comment.
Pull request overview
Fixes a GCC 11+ compilation error in the spatial extension by making the unique_ptr<BindData> → unique_ptr<FunctionData> return conversion explicit in ST_Distance_Sphere::BindData::Copy().
Changes:
- Update
ST_Distance_Sphere::BindData::Copy()toreturn std::move(copy);so the converting move constructor forunique_ptris used.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ST_Distance_Sphere::BindData::Copy()returnsunique_ptr<FunctionData>, but constructsunique_ptr<BindData>internally. Returningcopydirectly relies on an implicit derived-to-baseunique_ptrconversion that newer GCC (11+) rejects in a return statement without an explicitstd::move:The fix is a one-line change wrapping the return in
std::move().Diff
Scope
Verification
test/sql/join/*,test/sql/geometry/*,test/sql/geos/*)