public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r9-10055] libstdc++: Initialize member in std::match_results [PR103549] Date: Mon, 9 May 2022 16:39:54 +0000 (GMT) [thread overview] Message-ID: <20220509163954.EFD6C3857369@sourceware.org> (raw) https://gcc.gnu.org/g:756d1581d11c583d9cbfc2e0b7ce1a095845085e commit r9-10055-g756d1581d11c583d9cbfc2e0b7ce1a095845085e Author: Jonathan Wakely <jwakely@redhat.com> Date: Sat Dec 4 11:38:25 2021 +0000 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 <template-parameter-1-1> 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. (cherry picked from commit 87710ec7b213245ecb194b778e97ae3a6790394f) Diff: --- libstdc++-v3/include/bits/regex.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h index 9ca4cf8a815..8fd13b2f071 100644 --- a/libstdc++-v3/include/bits/regex.h +++ b/libstdc++-v3/include/bits/regex.h @@ -35,7 +35,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 template<typename, typename> class basic_regex; - template<typename, typename> + template<typename _Bi_iter, typename _Alloc> class match_results; _GLIBCXX_END_NAMESPACE_CXX11 @@ -1970,7 +1970,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 _M_suffix() { return _Base_type::operator[](_Base_type::size() - 1); } - _Bi_iter _M_begin; + _Bi_iter _M_begin {}; }; typedef match_results<const char*> cmatch;
reply other threads:[~2022-05-09 16:39 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220509163954.EFD6C3857369@sourceware.org \ --to=redi@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).