From 5e230d6240841dbc67f0c08ace3a1c24defea54f Mon Sep 17 00:00:00 2001 From: Paul Dreik Date: Sun, 9 Jun 2019 21:15:36 +0200 Subject: [PATCH] fix constexpr issues --- test/fuzzing/named_arg.cpp | 2 +- test/fuzzing/one_arg.cpp | 4 ++-- test/fuzzing/sprintf.cpp | 4 ++-- test/fuzzing/two_args.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/fuzzing/named_arg.cpp b/test/fuzzing/named_arg.cpp index c1bb65cc3b9e..beb4ad2e76d0 100644 --- a/test/fuzzing/named_arg.cpp +++ b/test/fuzzing/named_arg.cpp @@ -10,7 +10,7 @@ template void invoke_fmt(const uint8_t* Data, std::size_t Size, int argsize) { - const auto N1 = sizeof(Item1); + constexpr auto N1 = sizeof(Item1); if (Size <= N1) { return; } diff --git a/test/fuzzing/one_arg.cpp b/test/fuzzing/one_arg.cpp index 8c97e6201d8f..c29506d3d412 100644 --- a/test/fuzzing/one_arg.cpp +++ b/test/fuzzing/one_arg.cpp @@ -11,7 +11,7 @@ template void invoke_fmt(const uint8_t* Data, std::size_t Size) { - const auto N = sizeof(Item); + constexpr auto N = sizeof(Item); if (Size <= N) { return; } @@ -44,7 +44,7 @@ void invoke_fmt(const uint8_t* Data, std::size_t Size) { void invoke_fmt_time(const uint8_t* Data, std::size_t Size) { using Item = std::time_t; - const auto N = sizeof(Item); + constexpr auto N = sizeof(Item); if (Size <= N) { return; } diff --git a/test/fuzzing/sprintf.cpp b/test/fuzzing/sprintf.cpp index 17e66c5b1502..6b8b6f08c54a 100644 --- a/test/fuzzing/sprintf.cpp +++ b/test/fuzzing/sprintf.cpp @@ -20,8 +20,8 @@ template <> bool assignFromBuf(const uint8_t* Data, std::size_t Size) { template void invoke_fmt(const uint8_t* Data, std::size_t Size) { - const auto N1 = sizeof(Item1); - const auto N2 = sizeof(Item2); + constexpr auto N1 = sizeof(Item1); + constexpr auto N2 = sizeof(Item2); static_assert(N1 <= Nmax, "size1 exceeded"); static_assert(N2 <= Nmax, "size2 exceeded"); if (Size <= Nmax + Nmax) { diff --git a/test/fuzzing/two_args.cpp b/test/fuzzing/two_args.cpp index 95692def291c..293c0a7dde45 100644 --- a/test/fuzzing/two_args.cpp +++ b/test/fuzzing/two_args.cpp @@ -9,8 +9,8 @@ constexpr auto Nmax = std::max(sizeof(long double), sizeof(std::intmax_t)); template void invoke_fmt(const uint8_t* Data, std::size_t Size) { - const auto N1 = sizeof(Item1); - const auto N2 = sizeof(Item2); + constexpr auto N1 = sizeof(Item1); + constexpr auto N2 = sizeof(Item2); static_assert(N1 <= Nmax, "size1 exceeded"); static_assert(N2 <= Nmax, "size2 exceeded"); if (Size <= Nmax + Nmax) {