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
- Repository
- rL LLVM
Event Timeline
llvm/trunk/unittests/Support/CheckedArithmeticTest.cpp | ||
---|---|---|
41 | 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? |
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?