Returning optional is much safer.
The previous API had potential to cause use of undefined variables, if the value passed by pointer was accidentally read afterwards.
Details
Details
Diff Detail
Diff Detail
Event Timeline
llvm/trunk/unittests/Support/CheckedArithmeticTest.cpp | ||
---|---|---|
41 ↗ | (On Diff #151212) | You might be able to write this and other non-None values as the bare integer, rather than explicitly wrapping it in Optional? (there should be an implicit conversion, I'd think) Or does something about the gtest framework get in the way of that? |
llvm/trunk/unittests/Support/CheckedArithmeticTest.cpp | ||
---|---|---|
41 ↗ | (On Diff #151212) | @dblaikie Hm I'm not sure whether it would work, EXPECT_EQ is not explicitly marked to expect a specific optional as a second parameter. |