Skip to content

Commit 3916571

Browse files
committed
Fixing errors reported by clang19/20
Signed-off-by: Hartmut Kaiser <[email protected]>
1 parent 884483d commit 3916571

File tree

23 files changed

+372
-87
lines changed

23 files changed

+372
-87
lines changed

.jenkins/lsu/env-clang-20.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
77

88
module purge
9-
module load cmake/4
9+
module load cmake # for now: cmake/4
1010
module load llvm/20
1111
module load boost/1.87.0-${build_type,,}
1212
module load hwloc
@@ -30,6 +30,8 @@ configure_extra_options+=" -DCMAKE_C_FLAGS=-fPIC"
3030
configure_extra_options+=" -DHPX_WITH_LOGGING=OFF"
3131
configure_extra_options+=" -DHPX_WITH_DATAPAR_BACKEND=EVE"
3232
configure_extra_options+=" -DHPX_WITH_FETCH_EVE=ON"
33+
configure_extra_options+=" -DHPX_WITH_FETCH_JSON=ON"
34+
configure_extra_options+=" -DHPX_COMMAND_LINE_HANDLING_WITH_JSON_CONFIGURATION_FILES=ON"
3335

3436
# The pwrapi library still needs to be set up properly on rostam
3537
# configure_extra_options+=" -DHPX_WITH_POWER_COUNTER=ON"

libs/core/algorithms/tests/unit/algorithms/all_of.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
// Copyright (c) 2014-2020 Hartmut Kaiser
1+
// Copyright (c) 2014-2025 Hartmut Kaiser
22
//
33
// SPDX-License-Identifier: BSL-1.0
44
// Distributed under the Boost Software License, Version 1.0. (See accompanying
55
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
66

7+
#include <hpx/config.hpp>
8+
9+
// CLang V19.1.1 ICE's while compiling this file
10+
#if !defined(HPX_CLANG_VERSION) || HPX_CLANG_VERSION != 190101
11+
712
#include <hpx/init.hpp>
813

914
#include <cstddef>
@@ -125,7 +130,7 @@ void all_of_bad_alloc_test()
125130
///////////////////////////////////////////////////////////////////////////////
126131
int hpx_main(hpx::program_options::variables_map& vm)
127132
{
128-
unsigned int seed = (unsigned int) std::time(nullptr);
133+
unsigned int seed = static_cast<unsigned int>(std::time(nullptr));
129134
if (vm.count("seed"))
130135
seed = vm["seed"].as<unsigned int>();
131136

@@ -148,7 +153,7 @@ int main(int argc, char* argv[])
148153
desc_commandline.add_options()("seed,s", value<unsigned int>(),
149154
"the random number generator seed to use for this run");
150155

151-
// By default this test should run on all available cores
156+
// By default, this test should run on all available cores
152157
std::vector<std::string> const cfg = {"hpx.os_threads=all"};
153158

154159
// Initialize and run HPX
@@ -161,3 +166,12 @@ int main(int argc, char* argv[])
161166

162167
return hpx::util::report_errors();
163168
}
169+
170+
#else
171+
172+
int main()
173+
{
174+
return 0;
175+
}
176+
177+
#endif

libs/core/algorithms/tests/unit/algorithms/any_of.cpp

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
// Copyright (c) 2014-2020 Hartmut Kaiser
1+
// Copyright (c) 2014-2025 Hartmut Kaiser
22
//
33
// SPDX-License-Identifier: BSL-1.0
44
// Distributed under the Boost Software License, Version 1.0. (See accompanying
55
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
66

7+
#include <hpx/config.hpp>
8+
9+
// CLang V19.1.1 ICE's while compiling this file
10+
#if !defined(HPX_CLANG_VERSION) || HPX_CLANG_VERSION != 190101
11+
712
#include <hpx/init.hpp>
813

914
#include <cstddef>
@@ -123,8 +128,15 @@ void any_of_bad_alloc_test()
123128
}
124129

125130
///////////////////////////////////////////////////////////////////////////////
126-
int hpx_main()
131+
int hpx_main(hpx::program_options::variables_map& vm)
127132
{
133+
unsigned int seed = static_cast<unsigned int>(std::time(nullptr));
134+
if (vm.count("seed"))
135+
seed = vm["seed"].as<unsigned int>();
136+
137+
std::cout << "using seed: " << seed << std::endl;
138+
std::srand(seed);
139+
128140
any_of_test();
129141
any_of_exception_test();
130142
any_of_bad_alloc_test();
@@ -138,7 +150,7 @@ int main(int argc, char* argv[])
138150
options_description desc_commandline(
139151
"Usage: " HPX_APPLICATION_STRING " [options]");
140152

141-
// By default this test should run on all available cores
153+
// By default, this test should run on all available cores
142154
std::vector<std::string> const cfg = {"hpx.os_threads=all"};
143155

144156
// Initialize and run HPX
@@ -151,3 +163,12 @@ int main(int argc, char* argv[])
151163

152164
return hpx::util::report_errors();
153165
}
166+
167+
#else
168+
169+
int main()
170+
{
171+
return 0;
172+
}
173+
174+
#endif

libs/core/algorithms/tests/unit/algorithms/none_of.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
// Copyright (c) 2014-2020 Hartmut Kaiser
1+
// Copyright (c) 2014-2025 Hartmut Kaiser
22
//
33
// SPDX-License-Identifier: BSL-1.0
44
// Distributed under the Boost Software License, Version 1.0. (See accompanying
55
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
66

7+
#include <hpx/config.hpp>
8+
9+
// CLang V19.1.1 ICE's while compiling this file
10+
#if !defined(HPX_CLANG_VERSION) || HPX_CLANG_VERSION != 190101
11+
712
#include <hpx/init.hpp>
813

914
#include <cstddef>
@@ -125,7 +130,7 @@ void none_of_bad_alloc_test()
125130
///////////////////////////////////////////////////////////////////////////////
126131
int hpx_main(hpx::program_options::variables_map& vm)
127132
{
128-
unsigned int seed = (unsigned int) std::time(nullptr);
133+
unsigned int seed = static_cast<unsigned int>(std::time(nullptr));
129134
if (vm.count("seed"))
130135
seed = vm["seed"].as<unsigned int>();
131136

@@ -147,7 +152,7 @@ int main(int argc, char* argv[])
147152

148153
desc_commandline.add_options()("seed,s", value<unsigned int>(),
149154
"the random number generator seed to use for this run");
150-
// By default this test should run on all available cores
155+
// By default, this test should run on all available cores
151156
std::vector<std::string> const cfg = {"hpx.os_threads=all"};
152157

153158
// Initialize and run HPX
@@ -160,3 +165,12 @@ int main(int argc, char* argv[])
160165

161166
return hpx::util::report_errors();
162167
}
168+
169+
#else
170+
171+
int main()
172+
{
173+
return 0;
174+
}
175+
176+
#endif

libs/core/algorithms/tests/unit/container_algorithms/all_of_range.cpp

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
// Copyright (c) 2014-2020 Hartmut Kaiser
1+
// Copyright (c) 2014-2025 Hartmut Kaiser
22
// 2017 Bruno Pitrus
33

44
// SPDX-License-Identifier: BSL-1.0
55
// Distributed under the Boost Software License, Version 1.0. (See accompanying
66
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
77

8+
#include <hpx/config.hpp>
9+
10+
// CLang V19.1.1 ICE's while compiling this file
11+
#if !defined(HPX_CLANG_VERSION) || HPX_CLANG_VERSION != 190101
12+
813
#include <hpx/algorithm.hpp>
914
#include <hpx/init.hpp>
1015
#include <hpx/modules/testing.hpp>
@@ -28,8 +33,10 @@ void test_all_of_seq(IteratorTag, Proj proj = Proj())
2833
std::vector<std::size_t> c =
2934
test::fill_all_any_none(10007, i); //-V106
3035

31-
bool result = hpx::ranges::all_of(
32-
c, [](std::size_t v) { return v != 0; }, proj);
36+
// clang-format off
37+
bool result =
38+
hpx::ranges::all_of(c, [](std::size_t v) { return v != 0; }, proj);
39+
// clang-format on
3340

3441
// verify values
3542
bool expected = std::all_of(std::begin(c), std::end(c),
@@ -367,7 +374,7 @@ void all_of_bad_alloc_test()
367374
///////////////////////////////////////////////////////////////////////////////
368375
int hpx_main(hpx::program_options::variables_map& vm)
369376
{
370-
unsigned int seed = (unsigned int) std::time(nullptr);
377+
unsigned int seed = static_cast<unsigned int>(std::time(nullptr));
371378
if (vm.count("seed"))
372379
seed = vm["seed"].as<unsigned int>();
373380

@@ -390,7 +397,7 @@ int main(int argc, char* argv[])
390397
desc_commandline.add_options()("seed,s", value<unsigned int>(),
391398
"the random number generator seed to use for this run");
392399

393-
// By default this test should run on all available cores
400+
// By default, this test should run on all available cores
394401
std::vector<std::string> const cfg = {"hpx.os_threads=all"};
395402

396403
// Initialize and run HPX
@@ -403,3 +410,12 @@ int main(int argc, char* argv[])
403410

404411
return hpx::util::report_errors();
405412
}
413+
414+
#else
415+
416+
int main()
417+
{
418+
return 0;
419+
}
420+
421+
#endif

libs/core/algorithms/tests/unit/container_algorithms/any_of_range.cpp

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
// Copyright (c) 2014-2020 Hartmut Kaiser
1+
// Copyright (c) 2014-2025 Hartmut Kaiser
22
// 2017 Bruno Pitrus
33

44
// SPDX-License-Identifier: BSL-1.0
55
// Distributed under the Boost Software License, Version 1.0. (See accompanying
66
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
77

8+
#include <hpx/config.hpp>
9+
10+
// CLang V19.1.1 ICE's while compiling this file
11+
#if !defined(HPX_CLANG_VERSION) || HPX_CLANG_VERSION != 190101
12+
813
#include <hpx/algorithm.hpp>
914
#include <hpx/init.hpp>
1015
#include <hpx/modules/testing.hpp>
@@ -28,8 +33,10 @@ void test_any_of_seq(IteratorTag, Proj proj = Proj())
2833
std::vector<std::size_t> c =
2934
test::fill_all_any_none(10007, i); //-V106
3035

31-
bool result = hpx::ranges::any_of(
32-
c, [](std::size_t v) { return v != 0; }, proj);
36+
// clang-format off
37+
bool result =
38+
hpx::ranges::any_of(c, [](std::size_t v) { return v != 0; }, proj);
39+
// clang-format on
3340

3441
// verify values
3542
bool expected = std::any_of(std::begin(c), std::end(c),
@@ -367,7 +374,7 @@ void any_of_bad_alloc_test()
367374
///////////////////////////////////////////////////////////////////////////////
368375
int hpx_main(hpx::program_options::variables_map& vm)
369376
{
370-
unsigned int seed = (unsigned int) std::time(nullptr);
377+
unsigned int seed = static_cast<unsigned int>(std::time(nullptr));
371378
if (vm.count("seed"))
372379
seed = vm["seed"].as<unsigned int>();
373380

@@ -390,7 +397,7 @@ int main(int argc, char* argv[])
390397
desc_commandline.add_options()("seed,s", value<unsigned int>(),
391398
"the random number generator seed to use for this run");
392399

393-
// By default this test should run on all available cores
400+
// By default, this test should run on all available cores
394401
std::vector<std::string> const cfg = {"hpx.os_threads=all"};
395402

396403
// Initialize and run HPX
@@ -403,3 +410,12 @@ int main(int argc, char* argv[])
403410

404411
return hpx::util::report_errors();
405412
}
413+
414+
#else
415+
416+
int main()
417+
{
418+
return 0;
419+
}
420+
421+
#endif

libs/core/algorithms/tests/unit/container_algorithms/none_of_range.cpp

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
// Copyright (c) 2014-2020 Hartmut Kaiser
1+
// Copyright (c) 2014-2025 Hartmut Kaiser
22
// 2017 Bruno Pitrus
33

44
// SPDX-License-Identifier: BSL-1.0
55
// Distributed under the Boost Software License, Version 1.0. (See accompanying
66
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
77

8+
#include <hpx/config.hpp>
9+
10+
// CLang V19.1.1 ICE's while compiling this file
11+
#if !defined(HPX_CLANG_VERSION) || HPX_CLANG_VERSION != 190101
12+
813
#include <hpx/algorithm.hpp>
914
#include <hpx/init.hpp>
1015
#include <hpx/modules/testing.hpp>
@@ -27,8 +32,10 @@ void test_none_of_seq(IteratorTag, Proj proj = Proj())
2732
{
2833
std::vector<std::size_t> c = test::fill_all_any_none(3, i); //-V106
2934

30-
bool result = hpx::ranges::none_of(
31-
c, [](std::size_t v) { return v != 0; }, proj);
35+
// clang-format off
36+
bool result =
37+
hpx::ranges::none_of(c, [](std::size_t v) { return v != 0; }, proj);
38+
// clang-format on
3239

3340
// verify values
3441
bool expected = std::none_of(std::begin(c), std::end(c),
@@ -365,7 +372,7 @@ void none_of_bad_alloc_test()
365372
///////////////////////////////////////////////////////////////////////////////
366373
int hpx_main(hpx::program_options::variables_map& vm)
367374
{
368-
unsigned int seed = (unsigned int) std::time(nullptr);
375+
unsigned int seed = static_cast<unsigned int>(std::time(nullptr));
369376
if (vm.count("seed"))
370377
seed = vm["seed"].as<unsigned int>();
371378

@@ -387,7 +394,7 @@ int main(int argc, char* argv[])
387394

388395
desc_commandline.add_options()("seed,s", value<unsigned int>(),
389396
"the random number generator seed to use for this run");
390-
// By default this test should run on all available cores
397+
// By default, this test should run on all available cores
391398
std::vector<std::string> const cfg = {"hpx.os_threads=all"};
392399

393400
// Initialize and run HPX
@@ -400,3 +407,12 @@ int main(int argc, char* argv[])
400407

401408
return hpx::util::report_errors();
402409
}
410+
411+
#else
412+
413+
int main()
414+
{
415+
return 0;
416+
}
417+
418+
#endif

libs/core/algorithms/tests/unit/datapar_algorithms/all_of_datapar.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
// Copyright (c) 2021 Srinivas Yadav
2-
// Copyright (c) 2014-2020 Hartmut Kaiser
2+
// Copyright (c) 2014-2025 Hartmut Kaiser
33
//
44
// SPDX-License-Identifier: BSL-1.0
55
// Distributed under the Boost Software License, Version 1.0. (See accompanying
66
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
77

8+
#include <hpx/config.hpp>
9+
10+
// CLang V19.1.1 ICE's while compiling this file
11+
#if !defined(HPX_CLANG_VERSION) || HPX_CLANG_VERSION != 190101
12+
813
#include <hpx/datapar.hpp>
914
#include <hpx/init.hpp>
1015

@@ -80,3 +85,12 @@ int main(int argc, char* argv[])
8085

8186
return hpx::util::report_errors();
8287
}
88+
89+
#else
90+
91+
int main()
92+
{
93+
return 0;
94+
}
95+
96+
#endif

0 commit comments

Comments
 (0)