public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-9437] libstdc++: Initialize member in std::match_results [PR103549]
@ 2022-01-05 22:06 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2022-01-05 22:06 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:5e0ef5621b518caa593b77b7c8f202ee018a0900

commit r11-9437-g5e0ef5621b518caa593b77b7c8f202ee018a0900
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 a2eede6f3e4..a9a035e04d1 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
@@ -2080,7 +2080,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
       _M_suffix()
       { return _Base_type::operator[](_Base_type::size() - 1); }
 
-      _Bi_iter _M_begin;
+      _Bi_iter _M_begin {};
       /// @endcond
     };


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-05 22:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05 22:06 [gcc r11-9437] libstdc++: Initialize member in std::match_results [PR103549] Jonathan Wakely

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).