Skip to content

Mark __opstate classes as final instead of adding virtual destructors#1801

Merged
ericniebler merged 1 commit intoNVIDIA:mainfrom
janciesko:fix_virtual_ctors
Jan 29, 2026
Merged

Mark __opstate classes as final instead of adding virtual destructors#1801
ericniebler merged 1 commit intoNVIDIA:mainfrom
janciesko:fix_virtual_ctors

Conversation

@janciesko
Copy link
Copy Markdown
Contributor

  • Adds missing virtual modifiers to destructors in virtual classes.
  • Fixes warning [1] with clang++16.

[1]

warning: destructor called on non-final 'exec::__repeat_n::__opstate<stdexec::(anonymous namespace)::__sexpr<stdexec::(lambda at /ascldap/users/jciesko/RAndD/stdexec/include/stdexec/__detail/__basic_sender.hpp:56:53){}>, nvexec::_strm::propagate_receiver_t<nvexec::_strm::stream_enqueue_receiver<stdexec::__env::env<stdexec::__env::prop<nvexec::_strm::get_stream_provider_t, nvexec::_strm::stream_provider_t *>, stdexec::__env::__fwd<stdexec::__sync_wait::__env>::__t>, nvexec::variant_t<cuda::std::tuple<nvexec::_strm::set_noop>, cuda::std::tuple<stdexec::__rcvrs::set_error_t, cudaError>, cuda::std::tuple<stdexec::__rcvrs::set_error_t, std::__exception_ptr::exception_ptr>, cuda::std::tuple<stdexec::__rcvrs::set_stopped_t>, cuda::std::tuple<stdexec::__rcvrs::set_value_t>>>>::__t>' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
        __location->~_Tp();
        ^

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Jan 28, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copy link
Copy Markdown
Collaborator

@ericniebler ericniebler left a comment

Choose a reason for hiding this comment

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

my preference would be to make the __opstate class final rather than adding a bunch of vtable entries that won't be used.

Signed-off-by: Jan Ciesko <jan.ciesko@gmail.com>
@janciesko
Copy link
Copy Markdown
Contributor Author

Good point

@janciesko
Copy link
Copy Markdown
Contributor Author

janciesko commented Jan 28, 2026

Updated.

@janciesko janciesko requested a review from ericniebler January 28, 2026 23:59
@janciesko janciesko changed the title Add missing virtual modifiers Mark __opstate classes as final instead of adding virtual destructors Jan 28, 2026
@ericniebler
Copy link
Copy Markdown
Collaborator

/ok to test b444fb8

@ericniebler ericniebler merged commit 8251193 into NVIDIA:main Jan 29, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants