westonpace commented on a change in pull request #10955:
URL: https://github.com/apache/arrow/pull/10955#discussion_r718818177
##########
File path: cpp/src/arrow/testing/gtest_util.h
##########
@@ -94,7 +94,7 @@
#define ARROW_EXPECT_OK(expr) \
do { \
- auto _res = (expr); \
+ const auto& _res = (expr); \
Review comment:
Everything still runs ok and I think the lifetime of the temporary is
extended to the lifetime of the reference:
https://stackoverflow.com/questions/42868744/what-happens-when-assigning-an-rvalue-to-const-auto
Full disclaimer, I did not recognize this myself, it was my IDE complaining.
I don't feel strongly about the change and am happy to revert back.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]