diff options
| author | Martin Hořeňovský | 2023-07-25 16:59:12 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2023-08-10 21:02:18 +0200 |
| commit | d7304f0c41cd964e67d8fadd4c5acf65f2f4dbcc (patch) | |
| tree | 3b2f33b89811a57c8accfedba564c867054de39c /src/catch2/internal | |
| parent | cd60a0301cf8dd8da076166ad865f21325bc24fe (diff) | |
| download | catch3-d7304f0c41cd964e67d8fadd4c5acf65f2f4dbcc.tar.gz | |
Constify section hints in static-analysis mode
This prevents a `misc-const-correctness` in clang-tidy
Diffstat (limited to 'src/catch2/internal')
| -rw-r--r-- | src/catch2/internal/catch_section.hpp | 4 |
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__ ) \ |