Skip to content

Commit

Permalink
PR #22953: Fix const qualifier on status prevents automatic move sema…
Browse files Browse the repository at this point in the history
…ntics

Imported from GitHub PR #22953

reason for change - const qualifier on `status` prevents automatic move semantics in return.

When return status; is executed, the compiler cannot invoke the move constructor of `absl::Status` because status is const.
Copybara import of the project:

--
b172231 by Alexander Pivovarov <[email protected]>:

Fix const qualifier on status prevents automatic move semantics

Merging this change closes #22953

FUTURE_COPYBARA_INTEGRATE_REVIEW=#22953 from apivovarov:fix_rnvo b172231
PiperOrigin-RevId: 730627732
  • Loading branch information
apivovarov authored and Google-ML-Automation committed Feb 25, 2025
1 parent 2efc815 commit 1cd0869
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xla/status_macros.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static absl::Status MakeError(const char* filename, int line,
LOG(ERROR) << "Cannot create error with status OK";
code = absl::StatusCode::kUnknown;
}
const absl::Status status = absl::Status(code, message);
absl::Status status = absl::Status(code, message);
if (ABSL_PREDICT_TRUE(should_log)) {
LogError(status, filename, line, log_severity, should_log_stack_trace);
}
Expand Down

0 comments on commit 1cd0869

Please sign in to comment.