Skip to content

Commit

Permalink
Patch for gcc 14
Browse files Browse the repository at this point in the history
* ra/small.hh (select): always_false takes type.
* ra/tuples.hh (ic_t, ic): Normalize constness, which doesn't matter here. Not
  doing this broke the match_small assert in ra/ra.hh that RA_DO_OPT_SMALLVECTOR
  depends on.
  • Loading branch information
lloda committed May 8, 2024
1 parent 3868dd7 commit 5a110d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ra/small.hh
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ struct ViewSmall: public SmallBase<T, lens, steps>
select(is_iota auto i)
{
if constexpr ((1>=i.n ? 1 : (i.s<0 ? -i.s : i.s)*(i.n-1)+1) > len(k)) { // FIXME c++23 std::abs
static_assert(always_false<k>, "Bad index.");
static_assert(always_false<decltype(k)>, "Bad index.");
} else {
RA_CHECK(inside(i, len(k)), "Bad index iota [", i.n, " ", i.i, " ", i.s, "] in len[", k, "]=", len(k), ".");
}
Expand Down
4 changes: 2 additions & 2 deletions ra/tuples.hh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ template <class T> constexpr bool is_constant = false;
template <class T, T N> constexpr bool is_constant<std::integral_constant<T, N>> = true;
template <int V> using int_c = std::integral_constant<int, V>;
template <bool V> using bool_c = std::integral_constant<bool, V>;
template <auto V> using ic_t = std::integral_constant<decltype(V), V>;
template <auto V> constexpr std::integral_constant<decltype(V), V> ic {};
template <auto V> using ic_t = std::integral_constant<std::remove_const_t<decltype(V)>, V>;
template <auto V> constexpr std::integral_constant<std::remove_const_t<decltype(V)>, V> ic {};
template <class ... T> constexpr bool always_false = false; // p2593r0

} // namespace ra
Expand Down

0 comments on commit 5a110d1

Please sign in to comment.