]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Constrain __gnu_debug::bitset(const CharT*) constructor [PR121046]
authorJonathan Wakely <jwakely@redhat.com>
Sat, 12 Jul 2025 12:09:03 +0000 (13:09 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 12 Sep 2025 13:08:23 +0000 (14:08 +0100)
The r16-3435-gbbc0e70b610f19 change (for LWG 4294) needs to be applied
to the debug mode __gnu_debug::bitset as well as the normal one.

libstdc++-v3/ChangeLog:

PR libstdc++/121046
* include/debug/bitset (bitset(const CharT*, ...)): Add
constraints on CharT type.

libstdc++-v3/include/debug/bitset

index e4d3e6619c96c1e6ae06d3f812400b78e1dca623..2f4bab8463974858bd4952c3dfa7f87f2111de17 100644 (file)
@@ -179,7 +179,13 @@ namespace __debug
       bitset(const _Base& __x) : _Base(__x) { }
 
 #if __cplusplus >= 201103L
-      template<typename _CharT>
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 4294. bitset(const CharT*) constructor needs to be constrained
+      template<typename _CharT,
+              typename = _Require<is_trivially_copyable<_CharT>,
+                                  is_standard_layout<_CharT>,
+                                  is_trivially_default_constructible<_CharT>,
+                                  __not_<is_array<_CharT>>>>
        _GLIBCXX23_CONSTEXPR
         explicit
         bitset(const _CharT* __str,