diff --git a/cpp/src/arrow/status.cc b/cpp/src/arrow/status.cc index 81f5f88e0f0d1..8cbc6842c4bc3 100644 --- a/cpp/src/arrow/status.cc +++ b/cpp/src/arrow/status.cc @@ -167,7 +167,7 @@ void Status::AddContextLine(const char* filename, int line, const char* expr) { // We can't add context lines to a StatusConstant's state, so copy it now state_ = new State{code(), /*is_constant=*/false, message(), detail()}; } - const_cast(state_)->msg += ss.str(); + state_->msg += ss.str(); } #endif diff --git a/cpp/src/arrow/status.h b/cpp/src/arrow/status.h index a52a3600e434d..853fc284ee317 100644 --- a/cpp/src/arrow/status.h +++ b/cpp/src/arrow/status.h @@ -375,7 +375,7 @@ class ARROW_EXPORT [[nodiscard]] Status : public util::EqualityComparable