Constify section hints in static-analysis mode

This prevents a `misc-const-correctness` in clang-tidy
This commit is contained in:
Martin Hořeňovský 2023-07-25 16:59:12 +02:00
parent cd60a0301c
commit d7304f0c41
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A

View File

@ -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__ ) \