Skip to content

Commit

Permalink
Fix modules test by using static constexpr arrays (#3588)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanTLavavej authored Mar 24, 2023
1 parent f0bf77e commit 5e60382
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/std/include/test_header_units_and_modules.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ void test_istream() {
void test_iterator() {
using namespace std;
puts("Testing <iterator>.");
constexpr int arr[]{10, 20, 30, 40, 50};
static constexpr int arr[]{10, 20, 30, 40, 50};
constexpr reverse_iterator<const int*> ri{end(arr)};
assert(*ri == 50);
assert(*next(ri) == 40);
Expand Down Expand Up @@ -685,7 +685,7 @@ void test_source_location() {
void test_span() {
using namespace std;
puts("Testing <span>.");
constexpr int arr[]{11, 22, 33, 44, 55};
static constexpr int arr[]{11, 22, 33, 44, 55};
constexpr span<const int, 5> whole{arr};
constexpr span<const int, 3> mid = whole.subspan<1, 3>();
assert(mid[0] == 22 && mid[1] == 33 && mid[2] == 44);
Expand Down

0 comments on commit 5e60382

Please sign in to comment.