Skip to content

Commit

Permalink
[XLA:runtime] Fix compilation problem under MSVC.
Browse files Browse the repository at this point in the history
~Argument() names the destructor of the superclass, and MSVC rightly complains about it in the event that (*self)[i] does not return an Argument, which it does in some cases.

PiperOrigin-RevId: 563615070
  • Loading branch information
hawkinsp authored and copybara-github committed Sep 8, 2023
1 parent 62a2531 commit cfac4c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xla/runtime/arguments.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ class Arguments {
}

~Arguments() {
for (size_t i = 0; i < storage_.size(); ++i) (*this)[i].~Argument();
for (size_t i = 0; i < storage_.size(); ++i) {
reinterpret_cast<Argument*>(storage_[i].data)->~Argument();
}
}

template <typename T>
Expand Down

0 comments on commit cfac4c3

Please sign in to comment.