Skip to content

Commit

Permalink
Tell lcov to ignore std::is_constant_evaluated
Browse files Browse the repository at this point in the history
  • Loading branch information
tcbrindle committed Aug 22, 2024
1 parent 56d1bf4 commit 28dba23
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions include/flux/core/numeric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ struct checked_add_fn {
// constant evaluation already checks for overflow
if (signed_integral<T> && (sizeof(T) >= sizeof(int)) &&
std::is_constant_evaluated()) {
return unchecked_add_fn{}(lhs, rhs);
return unchecked_add_fn{}(lhs, rhs); // LCOV_EXCL_LINE
} else {
auto result = overflowing_add_fn{}(lhs, rhs);
if (result.overflowed) {
Expand All @@ -321,7 +321,7 @@ struct checked_sub_fn {
{
if (signed_integral<T> && (sizeof(T) >= sizeof(int)) &&
std::is_constant_evaluated()) {
return unchecked_sub_fn{}(lhs, rhs);
return unchecked_sub_fn{}(lhs, rhs); // LCOV_EXCL_LINE
} else {
auto result = overflowing_sub_fn{}(lhs, rhs);
if (result.overflowed) {
Expand All @@ -341,7 +341,7 @@ struct checked_mul_fn {
{
if (signed_integral<T> && (sizeof(T) >= sizeof(int)) &&
std::is_constant_evaluated()) {
return unchecked_mul_fn{}(lhs, rhs);
return unchecked_mul_fn{}(lhs, rhs); // LCOV_EXCL_LINE
} else {
auto result = overflowing_mul_fn{}(lhs, rhs);
if (result.overflowed) {
Expand Down
2 changes: 1 addition & 1 deletion include/flux/op/compare.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct compare_fn {

if constexpr (can_memcmp) {
if (std::is_constant_evaluated()) {
return impl(seq1, seq2, cmp);
return impl(seq1, seq2, cmp); // LCOV_EXCL_LINE
} else {
auto const seq1_size = flux::usize(seq1);
auto const seq2_size = flux::usize(seq2);
Expand Down
2 changes: 1 addition & 1 deletion include/flux/op/equal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct equal_fn {

if constexpr (can_memcmp) {
if (std::is_constant_evaluated()) {
return impl(seq1, seq2, cmp);
return impl(seq1, seq2, cmp); // LCOV_EXCL_LINE
} else {
auto size = flux::usize(seq1);
if(size == 0) {
Expand Down
2 changes: 1 addition & 1 deletion include/flux/op/fill.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct fill_fn {

if constexpr (can_memset) {
if (std::is_constant_evaluated()) {
impl(seq, value);
impl(seq, value); // LCOV_EXCL_LINE
} else {
auto size = flux::usize(seq);
if(size == 0) {
Expand Down
2 changes: 1 addition & 1 deletion include/flux/op/find.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct find_fn {

if constexpr (can_memchr) {
if (std::is_constant_evaluated()) {
return impl(seq, value);
return impl(seq, value); // LCOV_EXCL_LINE
} else {
auto size = flux::usize(seq);
if (size == 0) {
Expand Down
2 changes: 1 addition & 1 deletion include/flux/op/flatten_with.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ inline constexpr auto variant_emplace =
variant.template emplace<N>(FLUX_FWD(args)...);
} else {
if (std::is_constant_evaluated()) {
variant = std::variant<Types...>(std::in_place_index<N>, FLUX_FWD(args)...);
variant = std::variant<Types...>(std::in_place_index<N>, FLUX_FWD(args)...); // LCOV_EXCL_LINE
} else {
variant.template emplace<N>(FLUX_FWD(args)...);
}
Expand Down
2 changes: 1 addition & 1 deletion include/flux/op/output_to.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct output_to_fn {

if constexpr (can_memcpy) {
if (std::is_constant_evaluated()) {
return impl(seq, iter);
return impl(seq, iter); // LCOV_EXCL_LINE
} else {
auto size = flux::usize(seq);
if (size == 0) {
Expand Down

0 comments on commit 28dba23

Please sign in to comment.