public inbox for gcc-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 r12-7434] libstdc++: Fix -Wmaybe-uninitialized false positive [PR103984] Date: Tue, 1 Mar 2022 15:26:14 +0000 (GMT) [thread overview] Message-ID: <20220301152614.82F423858C83@sourceware.org> (raw) https://gcc.gnu.org/g:ad66b03b3c84786e73e73f09be19977b8f3c4ea3 commit r12-7434-gad66b03b3c84786e73e73f09be19977b8f3c4ea3 Author: Jonathan Wakely <jwakely@redhat.com> Date: Tue Mar 1 09:33:21 2022 +0000 libstdc++: Fix -Wmaybe-uninitialized false positive [PR103984] This fixes a false positive warning seen with LTO: 12/bits/regex_compiler.tcc:443:32: error: '__last_char._M_char' may be used uninitialized [-Werror=maybe-uninitialized] Given that the std::regex code is not very efficient anyway, the overhead of initializing this byte should be minimal. libstdc++-v3/ChangeLog: PR middle-end/103984 * include/bits/regex_compiler.h (_BracketMatcher::_M_char): Use default member initializer. Diff: --- libstdc++-v3/include/bits/regex_compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/include/bits/regex_compiler.h b/libstdc++-v3/include/bits/regex_compiler.h index 174aefe75f7..348c170c81a 100644 --- a/libstdc++-v3/include/bits/regex_compiler.h +++ b/libstdc++-v3/include/bits/regex_compiler.h @@ -125,7 +125,7 @@ namespace __detail struct _BracketState { enum class _Type : char { _None, _Char, _Class } _M_type = _Type::_None; - _CharT _M_char; + _CharT _M_char = _CharT(); void set(_CharT __c) noexcept { _M_type = _Type::_Char; _M_char = __c; }
reply other threads:[~2022-03-01 15:26 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=20220301152614.82F423858C83@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).