Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-07-25 16:59:12 +0200
committerMartin Hořeňovský2023-08-10 21:02:18 +0200
commitd7304f0c41cd964e67d8fadd4c5acf65f2f4dbcc (patch)
tree3b2f33b89811a57c8accfedba564c867054de39c /src/catch2
parentcd60a0301cf8dd8da076166ad865f21325bc24fe (diff)
downloadcatch3-d7304f0c41cd964e67d8fadd4c5acf65f2f4dbcc.tar.gz
Constify section hints in static-analysis mode
This prevents a `misc-const-correctness` in clang-tidy
Diffstat (limited to 'src/catch2')
-rw-r--r--src/catch2/internal/catch_section.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/catch2/internal/catch_section.hpp b/src/catch2/internal/catch_section.hpp
index bd92bdf4..8c894eeb 100644
--- a/src/catch2/internal/catch_section.hpp
+++ b/src/catch2/internal/catch_section.hpp
@@ -78,7 +78,7 @@ namespace Catch {
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \
- if ( [[maybe_unused]] int catchInternalPreviousSectionHint = \
+ if ( [[maybe_unused]] const int catchInternalPreviousSectionHint = \
catchInternalSectionHint, \
catchInternalSectionHint = Catch::Detail::GetNewSectionHint(); \
catchInternalPreviousSectionHint == __LINE__ ) \
@@ -88,7 +88,7 @@ namespace Catch {
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \
- if ( [[maybe_unused]] int catchInternalPreviousSectionHint = \
+ if ( [[maybe_unused]] const int catchInternalPreviousSectionHint = \
catchInternalSectionHint, \
catchInternalSectionHint = Catch::Detail::GetNewSectionHint(); \
catchInternalPreviousSectionHint == __LINE__ ) \