[PATCH] D48137: Change checked arithmetic functions API to return Optional
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 18 11:56:35 PDT 2018
dblaikie added inline comments.
================
Comment at: llvm/trunk/unittests/Support/CheckedArithmeticTest.cpp:41
+ EXPECT_EQ(checkedMul<int16_t>(Min, 2), None);
+ EXPECT_EQ(checkedMul<int16_t>(10, 2), Optional<int16_t>(20));
}
----------------
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?
Repository:
rL LLVM
https://reviews.llvm.org/D48137
More information about the llvm-commits
mailing list