[gcc r16-8798] libstdc++: Add _GLIBCXX_RESOLVE_LIB_DEFECTS for already implemented issues.

Tomasz Kaminski tkaminsk@gcc.gnu.org
Wed Apr 22 09:50:19 GMT 2026


https://gcc.gnu.org/g:02021cd894a4538cefe16960be181f89d1b05197

commit r16-8798-g02021cd894a4538cefe16960be181f89d1b05197
Author: Tomasz Kamiński <tkaminsk@redhat.com>
Date:   Wed Apr 22 10:21:54 2026 +0200

    libstdc++: Add _GLIBCXX_RESOLVE_LIB_DEFECTS for already implemented issues.
    
    This covers issue affecting pre-C+26 features that were resolved
    during 2026 Croydon meeting.
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/chrono_io.h: Add comment for LWG3831.
            * include/bits/print.h: Add comment for LWG4549.
            * include/std/condition_variable: Add comment for LWG3504.
            * include/std/format: Add comments for LWG4522.
            * include/std/mdspan: Add comment for LWG4314.
            * include/std/optional: Add comment for LWG2746.
    
    Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
    Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>

Diff:
---
 libstdc++-v3/include/bits/chrono_io.h       | 2 ++
 libstdc++-v3/include/bits/print.h           | 2 ++
 libstdc++-v3/include/std/condition_variable | 2 ++
 libstdc++-v3/include/std/format             | 4 ++++
 libstdc++-v3/include/std/mdspan             | 2 ++
 libstdc++-v3/include/std/optional           | 2 ++
 6 files changed, 14 insertions(+)

diff --git a/libstdc++-v3/include/bits/chrono_io.h b/libstdc++-v3/include/bits/chrono_io.h
index f5a0a65a48da..1fe50ad79e05 100644
--- a/libstdc++-v3/include/bits/chrono_io.h
+++ b/libstdc++-v3/include/bits/chrono_io.h
@@ -1313,6 +1313,8 @@ namespace __format
 
 	  int __yi = (int)__y;
 	  const bool __is_neg = __yi < 0;
+	  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+	  // 3831. Two-digit formatting of negative year is ambiguous
 	  __yi = __builtin_abs(__yi);
 	  int __ci = __yi / 100;
 	  // For floored division -123//100 is -2 and -100//100 is -1
diff --git a/libstdc++-v3/include/bits/print.h b/libstdc++-v3/include/bits/print.h
index 17567f2f5547..207248447264 100644
--- a/libstdc++-v3/include/bits/print.h
+++ b/libstdc++-v3/include/bits/print.h
@@ -282,6 +282,8 @@ namespace __format
   vprint_nonunicode_buffered(FILE* __stream, string_view __fmt,
 			     format_args __args)
   {
+    // _GLIBCXX_RESOLVE_LIB_DEFECTS
+    // 4549. vprint_nonunicode_buffered ignores its stream parameter
     __format::_Str_sink<char> __buf;
     std::vformat_to(__buf.out(), __fmt, __args);
     auto __out = __buf.view();
diff --git a/libstdc++-v3/include/std/condition_variable b/libstdc++-v3/include/std/condition_variable
index 9e515123e7c8..ce995ed57779 100644
--- a/libstdc++-v3/include/std/condition_variable
+++ b/libstdc++-v3/include/std/condition_variable
@@ -163,6 +163,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       wait_for(unique_lock<mutex>& __lock,
 	       const chrono::duration<_Rep, _Period>& __rtime)
       {
+	// _GLIBCXX_RESOLVE_LIB_DEFECTS
+	// 3504. condition_variable::wait_for is overspecified
 	using __dur = typename steady_clock::duration;
 	return wait_until(__lock,
 			  steady_clock::now() +
diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format
index 92add1e0a01c..4627381fa9e7 100644
--- a/libstdc++-v3/include/std/format
+++ b/libstdc++-v3/include/std/format
@@ -1718,6 +1718,8 @@ namespace __format
 	    {
 	      _CharT __wbuf[__buf_size];
 	      size_t __n = __narrow_str.size();
+	      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+	      // 4522. Clarify that `std::format` transcodes for `std::wformat_strings`
 	      std::__to_wstring_numeric(__narrow_str.data(), __n, __wbuf);
 	      return _M_format_int(basic_string_view<_CharT>(__wbuf, __n),
 				   __prefix_len, __fc);
@@ -2304,6 +2306,8 @@ namespace __format
 #ifdef _GLIBCXX_USE_WCHAR_T
 	  else
 	    {
+	      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+	      // 4522. Clarify that `std::format` transcodes for `std::wformat_strings`
 	      __wstr = std::__to_wstring_numeric(__narrow_str);
 	      __str = __wstr;
 	    }
diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/include/std/mdspan
index f30c5e83d164..14d8edc8ad17 100644
--- a/libstdc++-v3/include/std/mdspan
+++ b/libstdc++-v3/include/std/mdspan
@@ -103,6 +103,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	  }
 	else
 	  {
+	    // _GLIBCXX_RESOLVE_LIB_DEFECTS
+	    // 4314. Missing move in mdspan layout mapping::operator()
 	    auto __ret = static_cast<_IndexType>(std::forward<_OIndexTypeRef>(__other));
 	    if constexpr (std::is_signed_v<_IndexType>)
 	      __glibcxx_assert(__ret >= 0);
diff --git a/libstdc++-v3/include/std/optional b/libstdc++-v3/include/std/optional
index b9cc019feff7..e3c6ea209889 100644
--- a/libstdc++-v3/include/std/optional
+++ b/libstdc++-v3/include/std/optional
@@ -1144,6 +1144,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	  return *this;
 	}
 
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 2746. Inconsistency between requirements for emplace between optional and variant
       template<typename... _Args>
 	_GLIBCXX20_CONSTEXPR
 	enable_if_t<is_constructible_v<_Tp, _Args...>, _Tp&>


More information about the Libstdc++-cvs mailing list