From: Jonathan Wakely Date: Sat, 4 Dec 2021 11:38:25 +0000 (+0000) Subject: libstdc++: Initialize member in std::match_results [PR103549] X-Git-Tag: basepoints/gcc-13~2521 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87710ec7b213245ecb194b778e97ae3a6790394f;p=thirdparty%2Fgcc.git libstdc++: Initialize member in std::match_results [PR103549] This fixes a -Wuninitialized warning for std::cmatch m1, m2; m1=m2; Also name the template parameters in the forward declaration, to get rid of the noise in diagnostics. libstdc++-v3/ChangeLog: PR libstdc++/103549 * include/bits/regex.h (match_results): Give names to template parameters in first declaration. (match_results::_M_begin): Add default member-initializer. --- diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h index 785edc718009..52dcd7f86ae3 100644 --- a/libstdc++-v3/include/bits/regex.h +++ b/libstdc++-v3/include/bits/regex.h @@ -35,7 +35,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 template class basic_regex; - template + template class match_results; _GLIBCXX_END_NAMESPACE_CXX11 @@ -2109,7 +2109,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 _M_suffix() { return _Unchecked::operator[](_Unchecked::size() - 1); } - _Bi_iter _M_begin; + _Bi_iter _M_begin {}; /// @endcond };