Skip to content

Commit 1cd0869

Browse files
apivovarovGoogle-ML-Automation
authored andcommitted
PR #22953: Fix const qualifier on status prevents automatic move semantics
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
1 parent 2efc815 commit 1cd0869

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xla/status_macros.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static absl::Status MakeError(const char* filename, int line,
7777
LOG(ERROR) << "Cannot create error with status OK";
7878
code = absl::StatusCode::kUnknown;
7979
}
80-
const absl::Status status = absl::Status(code, message);
80+
absl::Status status = absl::Status(code, message);
8181
if (ABSL_PREDICT_TRUE(should_log)) {
8282
LogError(status, filename, line, log_severity, should_log_stack_trace);
8383
}

0 commit comments

Comments
 (0)