From cfac4c30bc62564805d3b934e138da2c6ba6252a Mon Sep 17 00:00:00 2001 From: Peter Hawkins Date: Thu, 7 Sep 2023 19:50:46 -0700 Subject: [PATCH] [XLA:runtime] Fix compilation problem under MSVC. ~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 --- xla/runtime/arguments.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xla/runtime/arguments.h b/xla/runtime/arguments.h index 3dca6333c6634..7604098e4efbf 100644 --- a/xla/runtime/arguments.h +++ b/xla/runtime/arguments.h @@ -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(storage_[i].data)->~Argument(); + } } template