BillyONeal updated this revision to Diff 98219.
BillyONeal marked 2 inline comments as done.
BillyONeal edited the summary of this revision.
BillyONeal added a comment.
Do Eric's suggestions.
https://reviews.llvm.org/D32309
Files:
test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
t
EricWF added inline comments.
Comment at: test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp:42
+constexpr bool test0(int in1, int in2, int out)
{
+static_assert(std::is_same EricWF wrote:
> > Nit but this seems much cleaner and more readable without the casts.
> >
BillyONeal added inline comments.
Comment at: test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp:42
+constexpr bool test0(int in1, int in2, int out)
{
+static_assert(std::is_same Nit but this seems much cleaner and more readable without the casts.
>
> ```
> auto val
EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.
LGTM, preferably with the suggested cleanups.
Comment at: test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp:146
+auto res = std::gcd(static_cast(1234), INT32
BillyONeal updated this revision to Diff 98205.
BillyONeal added a comment.
Resolved CR comments
https://reviews.llvm.org/D32309
Files:
test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
Index: test/std/numerics/numeric.ops
BillyONeal added inline comments.
Comment at: test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp:146
+auto res = std::gcd(static_cast(1234), INT32_MIN);
+static_assert(std::is_same>::value, "");
assert(res == 2);
EricWF wrote:
> `
EricWF added inline comments.
Comment at: test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp:146
+auto res = std::gcd(static_cast(1234), INT32_MIN);
+static_assert(std::is_same>::value, "");
assert(res == 2);
`std::common_type` he
CaseyCarter added inline comments.
Comment at: test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp:144
+auto res1 = std::lcm(static_cast(1234), INT32_MIN);
+(void)std::lcm(INT_MIN, 2UL); // this used to trigger UBSAN
+static_assert(std::is_same::value, "")
BillyONeal added a comment.
Hi folks, any update on this or is just fixing @rsmith's comment OK?
Thanks!
https://reviews.llvm.org/D32309
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm
BillyONeal added inline comments.
Comment at: test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp:46
+std::gcd(static_cast(0), static_cast(0)))>::value, "");
+const bool result = static_cast>(out) ==
+std::gcd(static_cast(in1), static_cast(in2));
--
rsmith added inline comments.
Comment at: test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp:46
+std::gcd(static_cast(0), static_cast(0)))>::value, "");
+const bool result = static_cast>(out) ==
+std::gcd(static_cast(in1), static_cast(in2));
--
BillyONeal updated this revision to Diff 96231.
BillyONeal added a comment.
Stephan had some code review comments :)
https://reviews.llvm.org/D32309
Files:
test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
Index: test/std/
12 matches
Mail list logo