From: Jonathan Wakely Date: Wed, 29 Oct 2025 21:37:18 +0000 (+0000) Subject: libstdc++: Fix -Wunused-variable from X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc78f8523832d693f9e1dd2f48964e27fb90b947;p=thirdparty%2Fgcc.git libstdc++: Fix -Wunused-variable from In r16-4709-gc55c1de3a9adb2 I meant to use the result of the static_cast for the rest of the function following it, but I accidentally used the original variable __ch. This causes -Wunused-variable warnings for the __c initialized from the cast. This fixes the rest of the function to use __c instead of __ch. libstdc++-v3/ChangeLog: * include/bits/regex.tcc (regex_traits::value): Use __c instead of __ch. --- diff --git a/libstdc++-v3/include/bits/regex.tcc b/libstdc++-v3/include/bits/regex.tcc index a0edf272717..48917cdfda9 100644 --- a/libstdc++-v3/include/bits/regex.tcc +++ b/libstdc++-v3/include/bits/regex.tcc @@ -348,11 +348,11 @@ namespace __detail { const char __c = static_cast(__ch); const char __max_digit = __radix == 8 ? '7' : '9'; - if ('0' <= __ch && __ch <= __max_digit) - return __ch - '0'; + if ('0' <= __c && __c <= __max_digit) + return __c - '0'; if (__radix < 16) return -1; - switch (__ch) + switch (__c) { case 'a': case 'A':