Skip to content
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

[c++] virtual destructor for gradient discretizer #5965

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

shiyu1994
Copy link
Collaborator

This is to fix the compilation warning.

/Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:2338:5: warning: delete called on non-final 'LightGBM::GradientDiscretizer' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
    delete __ptr;
    ^
/Applications/Xcode_11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:2651:7: note: in instantiation of member function 'std::__1::default_delete<LightGBM::GradientDiscretizer>::operator()' requested here
      __ptr_.second()(__tmp);
      ^
/Users/runner/work/1/s/lightgbm-python/src/treelearner/serial_tree_learner.cpp:65:27: note: in instantiation of member function 'std::__1::unique_ptr<LightGBM::GradientDiscretizer, std::__1::default_delete<LightGBM::GradientDiscretizer> >::reset' requested here
    gradient_discretizer_.reset(new GradientDiscretizer(config_->num_grad_quant_bins, config_->num_iterations, config_->seed, is_constant_hessian, config_->stochastic_rounding));
                          ^
1 warning generated.

See https://dev.azure.com/lightgbm-ci/lightgbm-ci/_build/results?buildId=14888&view=logs&j=52ea7a35-6bb0-5680-4def-de74fd7388e2&t=3a5da3c1-f658-52cd-3d24-edc674c4d20e for example.

Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@shiyu1994 shiyu1994 merged commit 28e0e6f into master Jul 12, 2023
39 checks passed
@shiyu1994 shiyu1994 deleted the fix-gradient-discretization-warning branch July 12, 2023 10:34
@jameslamb jameslamb mentioned this pull request Jul 12, 2023
19 tasks
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants