Skip to content

Commit 66bcf38

Browse files
authored
Use version 17 in all clang-tidy CIs (AMReX-Codes#3867)
1 parent d78e241 commit 66bcf38

16 files changed

+43
-55
lines changed

.clang-tidy

+2-14
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,5 @@ Checks: >
5252
# Files not ending with nolint.H will be filtered in.
5353
HeaderFilterRegex: '([^n].....|[^o]....|[^l]...|[^i]..|[^n].|[^t])\.H$'
5454

55-
CheckOptions:
56-
- key: bugprone-dynamic-static-initializers.HeaderFileExtensions
57-
value: ';H;h;hh;hpp;hxx'
58-
- key: bugprone-suspicious-include.HeaderFileExtensions
59-
value: ';H;h;hh;hpp;hxx'
60-
- key: google-global-names-in-headers.HeaderFileExtensions
61-
value: ';H;h;hh;hpp;hxx'
62-
- key: google-build-namespaces.HeaderFileExtensions
63-
value: ';H;h;hh;hpp;hxx'
64-
- key: misc-definitions-in-headers.HeaderFileExtensions
65-
value: ';H;h;hh;hpp;hxx'
66-
- key: misc-use-anonymous-namespace.HeaderFileExtensions
67-
value: ';H;h;hh;hpp;hxx'
68-
55+
# Only available in clang-tidy >= 17
56+
HeaderFileExtensions: ['', "H", 'h', 'hh', 'hpp', 'hxx']

.github/workflows/bittree.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Dependencies
1616
run: |
1717
.github/workflows/dependencies/dependencies.sh
18-
.github/workflows/dependencies/dependencies_clang-tidy.sh 15
18+
.github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 17
1919
.github/workflows/dependencies/dependencies_ccache.sh
2020
- name: Set Up Cache
2121
uses: actions/cache@v4
@@ -53,7 +53,7 @@ jobs:
5353
5454
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt
5555
make -j4 -k -f clang-tidy-ccache-misses.mak \
56-
CLANG_TIDY=clang-tidy-15 \
56+
CLANG_TIDY=clang-tidy-17 \
5757
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"
5858
5959
ccache -s
@@ -67,7 +67,7 @@ jobs:
6767
- name: Dependencies
6868
run: |
6969
.github/workflows/dependencies/dependencies.sh
70-
.github/workflows/dependencies/dependencies_clang-tidy.sh 15
70+
.github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 17
7171
.github/workflows/dependencies/dependencies_ccache.sh
7272
- name: Set Up Cache
7373
uses: actions/cache@v4
@@ -105,7 +105,7 @@ jobs:
105105
106106
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt
107107
make -j4 -k -f clang-tidy-ccache-misses.mak \
108-
CLANG_TIDY=clang-tidy-15 \
108+
CLANG_TIDY=clang-tidy-17 \
109109
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"
110110
111111
ccache -s

.github/workflows/clang.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Dependencies
2020
run: |
2121
.github/workflows/dependencies/dependencies_clang.sh 7
22-
.github/workflows/dependencies/dependencies_clang-tidy.sh 12
22+
.github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 17
2323
.github/workflows/dependencies/dependencies_ccache.sh
2424
- name: Set Up Cache
2525
uses: actions/cache@v4
@@ -60,7 +60,7 @@ jobs:
6060
6161
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt
6262
make -j4 -k -f clang-tidy-ccache-misses.mak \
63-
CLANG_TIDY=clang-tidy-12 \
63+
CLANG_TIDY=clang-tidy-17 \
6464
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"
6565
6666
export PATH=/tmp/my-amrex/bin:$PATH
@@ -79,7 +79,7 @@ jobs:
7979
- name: Dependencies
8080
run: |
8181
.github/workflows/dependencies/dependencies_clang.sh 14
82-
.github/workflows/dependencies/dependencies_clang-tidy.sh 14
82+
.github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 17
8383
.github/workflows/dependencies/dependencies_ccache.sh
8484
- name: Set Up Cache
8585
uses: actions/cache@v4
@@ -118,7 +118,7 @@ jobs:
118118
119119
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt
120120
make -j4 -k -f clang-tidy-ccache-misses.mak \
121-
CLANG_TIDY=clang-tidy-14 \
121+
CLANG_TIDY=clang-tidy-17 \
122122
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"
123123
124124
ctest --output-on-failure
@@ -135,7 +135,7 @@ jobs:
135135
- name: Dependencies
136136
run: |
137137
.github/workflows/dependencies/dependencies_clang.sh 14
138-
.github/workflows/dependencies/dependencies_clang-tidy.sh 14
138+
.github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 17
139139
.github/workflows/dependencies/dependencies_ccache.sh
140140
- name: Set Up Cache
141141
uses: actions/cache@v4
@@ -160,7 +160,7 @@ jobs:
160160
161161
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt
162162
make -j4 -k -f clang-tidy-ccache-misses.mak \
163-
CLANG_TIDY=clang-tidy-14 \
163+
CLANG_TIDY=clang-tidy-17 \
164164
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"
165165
166166
ccache -s

.github/workflows/hypre.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
- name: Dependencies
6767
run: |
6868
.github/workflows/dependencies/dependencies.sh
69-
.github/workflows/dependencies/dependencies_clang-tidy.sh 14
69+
.github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 17
7070
.github/workflows/dependencies/dependencies_ccache.sh
7171
- name: Set Up Cache
7272
uses: actions/cache@v4
@@ -101,7 +101,7 @@ jobs:
101101
102102
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt
103103
make -j4 -k -f clang-tidy-ccache-misses.mak \
104-
CLANG_TIDY=clang-tidy-14 \
104+
CLANG_TIDY=clang-tidy-17 \
105105
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"
106106
107107
ccache -s
@@ -115,7 +115,7 @@ jobs:
115115
- name: Dependencies
116116
run: |
117117
.github/workflows/dependencies/dependencies.sh
118-
.github/workflows/dependencies/dependencies_clang-tidy.sh 14
118+
.github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 17
119119
.github/workflows/dependencies/dependencies_ccache.sh
120120
- name: Set Up Cache
121121
uses: actions/cache@v4
@@ -149,7 +149,7 @@ jobs:
149149
150150
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt
151151
make -j4 -k -f clang-tidy-ccache-misses.mak \
152-
CLANG_TIDY=clang-tidy-14 \
152+
CLANG_TIDY=clang-tidy-17 \
153153
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"
154154
155155
ccache -s

.github/workflows/petsc.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Dependencies
1616
run: |
1717
.github/workflows/dependencies/dependencies.sh
18-
.github/workflows/dependencies/dependencies_clang-tidy.sh 14
18+
.github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 17
1919
.github/workflows/dependencies/dependencies_ccache.sh
2020
- name: Set Up Cache
2121
uses: actions/cache@v4
@@ -51,7 +51,7 @@ jobs:
5151
5252
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt
5353
make -j4 -k -f clang-tidy-ccache-misses.mak \
54-
CLANG_TIDY=clang-tidy-14 \
54+
CLANG_TIDY=clang-tidy-17 \
5555
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"
5656
5757
ccache -s

.github/workflows/smoke.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Dependencies
1616
run: |
1717
.github/workflows/dependencies/dependencies.sh
18-
.github/workflows/dependencies/dependencies_clang-tidy.sh 15
18+
.github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 17
1919
.github/workflows/dependencies/dependencies_ccache.sh
2020
- name: Set Up Cache
2121
uses: actions/cache@v4
@@ -48,7 +48,7 @@ jobs:
4848
4949
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt
5050
make -j4 -k -f clang-tidy-ccache-misses.mak \
51-
CLANG_TIDY=clang-tidy-15 \
51+
CLANG_TIDY=clang-tidy-17 \
5252
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"
5353
5454
mkdir ../Tests/SpackSmokeTest/build

.github/workflows/sundials.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
cd ../..
4747
- name: Compile Test
4848
run: |
49-
.github/workflows/dependencies/dependencies_clang-tidy.sh 14
49+
.github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 17
5050
export CXXFLAGS="-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs"
5151
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy
5252
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt
@@ -61,7 +61,7 @@ jobs:
6161
6262
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt
6363
make -j4 -k -f clang-tidy-ccache-misses.mak \
64-
CLANG_TIDY=clang-tidy-14 \
64+
CLANG_TIDY=clang-tidy-17 \
6565
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"
6666
6767
ccache -s

Src/Extern/HYPRE/AMReX_Hypre.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ Hypre::Hypre (const BoxArray& grids, const DistributionMapping& dmap,
3232
static_assert(AMREX_SPACEDIM > 1, "Hypre: 1D not supported");
3333

3434
// This is not static_assert because HypreSolver class does not require this.
35-
if (!std::is_same<Real, HYPRE_Real>::value) {
35+
if (!std::is_same_v<Real, HYPRE_Real>) {
3636
amrex::Abort("amrex::Real != HYPRE_Real");
3737
}
3838

3939
#ifdef HYPRE_BIGINT
40-
static_assert(std::is_same<long long int, HYPRE_Int>::value, "long long int != HYPRE_Int");
40+
static_assert(std::is_same_v<long long int, HYPRE_Int>, "long long int != HYPRE_Int");
4141
#else
42-
static_assert(std::is_same<int, HYPRE_Int>::value, "int != HYPRE_Int");
42+
static_assert(std::is_same_v<int, HYPRE_Int>, "int != HYPRE_Int");
4343
#endif
4444

4545
const int ncomp = 1;

Src/Extern/HYPRE/AMReX_HypreABecLap.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ HypreABecLap::solve (MultiFab& soln, const MultiFab& rhs, Real reltol, Real abst
8686

8787
amrex::Print() << "\n" << num_iterations
8888
<< " Hypre PFMG Iterations, Relative Residual "
89-
<< res << std::endl;
89+
<< res << '\n';
9090
}
9191

9292
getSolution(soln);

Src/Extern/HYPRE/AMReX_HypreABecLap2.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ HypreABecLap2::solve (MultiFab& soln, const MultiFab& rhs, Real reltol, Real abs
103103

104104
amrex::Print() << "\n" << num_iterations
105105
<< " Hypre SS BoomerAMG Iterations, Relative Residual "
106-
<< res << std::endl;
106+
<< res << '\n';
107107
}
108108

109109
getSolution(soln);

Src/Extern/HYPRE/AMReX_HypreABecLap3.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ HypreABecLap3::prepareSolver ()
104104
}
105105
#endif
106106

107-
static_assert(std::is_signed<HYPRE_Int>::value, "HYPRE_Int is assumed to be signed");
107+
static_assert(std::is_signed_v<HYPRE_Int>, "HYPRE_Int is assumed to be signed");
108108

109109
// how many non-covered cells do we have?
110110
ncells_grid.define(ba,dm);

Src/Extern/HYPRE/AMReX_HypreIJIface.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct HypreOptParse
2727
if (pp.contains(key.c_str())) {
2828
int val;
2929
pp.query(key.c_str(), val);
30-
func(solver, val);
30+
std::forward<F>(func)(solver, val);
3131
}
3232
}
3333

@@ -36,15 +36,15 @@ struct HypreOptParse
3636
{
3737
T val = default_val;
3838
pp.queryAdd(key.c_str(), val);
39-
func(solver, val);
39+
std::forward<F>(func)(solver, val);
4040
}
4141

4242
template <typename F, typename T>
4343
void operator() (const std::string& key, F&& func, T default_val, int index)
4444
{
4545
T val = default_val;
4646
pp.queryAdd(key.c_str(), val);
47-
func(solver, val, index);
47+
std::forward<F>(func)(solver, val, index);
4848
}
4949

5050
template <typename T, typename F>
@@ -53,7 +53,7 @@ struct HypreOptParse
5353
if (pp.contains(key.c_str())) {
5454
T val;
5555
pp.query(key.c_str(), val);
56-
func(solver, val);
56+
std::forward<F>(func)(solver, val);
5757
}
5858
}
5959
};
@@ -165,7 +165,7 @@ void HypreIJIface::solve (
165165
amrex::Print() << "HYPRE " << m_solver_name
166166
<< ": Num. iterations = " << m_num_iterations
167167
<< "; Relative residual = " << m_final_res_norm
168-
<< std::endl;
168+
<< '\n';
169169
}
170170
}
171171

@@ -183,7 +183,7 @@ void HypreIJIface::parse_inputs (const std::string& prefix)
183183
if (m_verbose > 2) {
184184
amrex::Print() << "HYPRE: solver = " << m_solver_name
185185
<< "; preconditioner = " << m_preconditioner_name
186-
<< std::endl;
186+
<< '\n';
187187
}
188188

189189
if (m_preconditioner_name == "none") {
@@ -235,7 +235,7 @@ void HypreIJIface::init_solver (
235235
void HypreIJIface::boomeramg_precond_configure (const std::string& prefix)
236236
{
237237
if (m_verbose > 2) {
238-
amrex::Print() << "Creating BoomerAMG preconditioner" << std::endl;
238+
amrex::Print() << "Creating BoomerAMG preconditioner" << '\n';
239239
}
240240
HYPRE_BoomerAMGCreate(&m_precond);
241241

@@ -433,7 +433,7 @@ void HypreIJIface::boomeramg_solver_configure (const std::string& prefix)
433433
void HypreIJIface::gmres_solver_configure (const std::string& prefix)
434434
{
435435
if (m_verbose > 2) {
436-
amrex::Print() << "Creating GMRES solver" << std::endl;
436+
amrex::Print() << "Creating GMRES solver" << '\n';
437437
}
438438
HYPRE_ParCSRGMRESCreate(m_comm, &m_solver);
439439

Src/Extern/HYPRE/AMReX_HypreNodeLap.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ HypreNodeLap::HypreNodeLap (const BoxArray& grids_, const DistributionMapping& d
2020
options_namespace(std::move(options_namespace_))
2121
{
2222
static_assert(AMREX_SPACEDIM > 1, "HypreNodeLap: 1D not supported");
23-
static_assert(std::is_same<Real, HYPRE_Real>::value, "amrex::Real != HYPRE_Real");
23+
static_assert(std::is_same_v<Real, HYPRE_Real>, "amrex::Real != HYPRE_Real");
2424

2525
int num_procs, myid;
2626
MPI_Comm_size(comm, &num_procs);

Src/Extern/HYPRE/AMReX_HypreSolver.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ HypreSolver<MSS>::HypreSolver (Vector<IndexType> const& a_index_type,
217217
m_cell_offset.define(m_grids[0], m_dmap);
218218
#endif
219219

220-
fill_local_id(a_marker);
220+
fill_local_id(std::forward<Marker>(a_marker));
221221

222222
// At this point, m_local_id stores the ids local to each box.
223223
// m_nrows_grid stores the number of unique points in each box.
@@ -267,7 +267,7 @@ HypreSolver<MSS>::HypreSolver (Vector<IndexType> const& a_index_type,
267267
m_b = m_hypre_ij->b();
268268
m_x = m_hypre_ij->x();
269269

270-
fill_matrix(a_filler);
270+
fill_matrix(std::forward<Filler>(a_filler));
271271
}
272272

273273
template <int MSS>

Src/Extern/PETSc/AMReX_PETSc.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ PETScABecLap::PETScABecLap (const BoxArray& grids, const DistributionMapping& dm
6464
geom(geom_)
6565
{
6666
static_assert(AMREX_SPACEDIM > 1, "PETScABecLap: 1D not supported");
67-
static_assert(std::is_same<Real, PetscScalar>::value, "amrex::Real != PetscScalar");
67+
static_assert(std::is_same_v<Real, PetscScalar>, "amrex::Real != PetscScalar");
6868

6969
const int ncomp = 1;
7070
int ngrow = 0;
@@ -168,7 +168,7 @@ PETScABecLap::solve (MultiFab& soln, const MultiFab& rhs, Real rel_tol, Real /*a
168168
Real res;
169169
KSPGetIterationNumber(solver->a, &niters);
170170
KSPGetResidualNorm(solver->a, &res);
171-
amrex::Print() <<"\n" << niters << " PETSc Iterations, Residual Norm " << res << std::endl;
171+
amrex::Print() <<"\n" << niters << " PETSc Iterations, Residual Norm " << res << '\n';
172172
}
173173

174174
getSolution(soln);
@@ -192,7 +192,7 @@ PETScABecLap::prepareSolver ()
192192
}
193193
#endif
194194

195-
static_assert(std::is_signed<PetscInt>::value, "PetscInt is assumed to be signed");
195+
static_assert(std::is_signed_v<PetscInt>, "PetscInt is assumed to be signed");
196196

197197
// how many non-covered cells do we have?
198198
ncells_grid.define(ba,dm);

Src/Extern/SUNDIALS/AMReX_Sundials.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <AMReX_Sundials_Core.H>
77
#include <AMReX_SUNMemory.H>
88

9-
static_assert(std::is_same<amrex::Real,sunrealtype>::value,
9+
static_assert(std::is_same_v<amrex::Real,sunrealtype>,
1010
"amrex::Real must be the same as SUNDIALS sunrealtype");
1111

1212
#endif

0 commit comments

Comments
 (0)