-
Notifications
You must be signed in to change notification settings - Fork 915
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
Change cudf::scalar copy and move constructors to protected #8857
Change cudf::scalar copy and move constructors to protected #8857
Conversation
Codecov Report
@@ Coverage Diff @@
## branch-21.10 #8857 +/- ##
================================================
- Coverage 10.67% 10.59% -0.09%
================================================
Files 110 116 +6
Lines 18271 19034 +763
================================================
+ Hits 1951 2017 +66
- Misses 16320 17017 +697
Continue to review full report at Codecov.
|
@gpucibot merge |
An instance of the
cudf::scalar
base class can currently through it's public copy constructor using the following example:This line builds the numeric scalar instance, passes it to the base scalar's copy-ctor, and then destroys it.
(Simpler example here to show that this is happening: https://godbolt.org/z/hGEGvsqjq )
This means that the
b
instance is actually a plaincudf::scalar
with no derived type.Downcasting with dynamic_cast can runtime-check the object but we could have this line fail at compile time by making the
cudf::scalar
copy-ctor protected.We could make the ctor explicit but I think making it protected would more clearly communicate the intention of the class.
This PR makes the
cudf::scalar
copy and move constructors protected to prevent instantiating acudf::scalar
at compile time.