catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Constify section hints in static-analysis mode
- Commit
d7304f0c41cd964e67d8fadd4c5acf65f2f4dbcc- Author
- Martin Hořeňovský ·
- Parents
cd60a0301cf8
Changes
src/catch2/internal/catch_section.hpp | 4 ++-- 1 file 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__ ) \