]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Define feature test macros for hardened implementation
authorJonathan Wakely <jwakely@redhat.com>
Thu, 21 May 2026 15:38:58 +0000 (16:38 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 3 Jun 2026 14:55:10 +0000 (15:55 +0100)
The P3471R4 and P3697R1 proposals adding hardened preconditions also
defined feature test macros that indicate whether the hardened
preconditions are checked. For our implementation, those checks are
enabled by defining _GLIBCXX_ASSERTIONS.

To implement this, I've added all the __cpp_lib_hardened_xxx macros at
the end of bits/version.def, because the simplest way to define many of
them seems to be to make the depend on the macro for the main feature
and additionally depend on defined(_GLIBCXX_ASSERTIONS).

The hardening checks were added to each component as follows:

std::array                  r11-4854-g6db082477ad839
std::bitset                 r16-7919-g1b404c574450a4
std::deque                  r7-1526-gbd2ee798d5a5a3
std::expected               since first commit
std::forward_list           r15-5721-ge7aa614d7372b5
std::inplace_vector         since first commit
std::common_iterator        since first commit
std::counted_iterator       since first commit
std::list                   r15-5721-ge7aa614d7372b5
std::shared_ptr<T[]>        since first commit
std::optional               r8-711-g2c27a627a31034
std::ranges::view_interface since first commit
std::span                   r10-2983-gb5c433ce11a140
std::basic_stacktrace       since first commit
std::basic_string           r6-3197-g2f1e8e7c4730bb
std::basic_string_view      r11-2881-g3eefb302d2bd85
std::valarray               r6-3197-g2f1e8e7c4730bb
std::vector                 r6-3197-g2f1e8e7c4730bb

This commit does not define __cpp_lib_hardened_mdspan, that was added in
r17-1258-g19def756dec1fe earlier today.

This commit does not include the LWG 4577 changes to harden
view_interface::operator[] which will be added later (with a new value
for the __cpp_lib_hardened_view_interface macro).

libstdc++-v3/ChangeLog:

* include/bits/version.def: Define macros for hardened
preconditions.
* include/bits/version.h: Regenerate.
* include/std/array: Define "want" macro for hardened
precondition macro.
* include/std/bitset: Likewise.
* include/std/deque: Likewise.
* include/std/expected: Likewise.
* include/std/forward_list: Likewise.
* include/std/inplace_vector: Likewise.
* include/std/iterator: Likewise.
* include/std/list: Likewise.
* include/std/memory: Likewise.
* include/std/optional: Likewise.
* include/std/ranges: Likewise.
* include/std/span: Likewise.
* include/std/stacktrace: Likewise.
* include/std/string: Likewise.
* include/std/string_view: Likewise.
* include/std/valarray: Likewise.
* include/std/vector: Likewise.
* testsuite/23_containers/array/tuple_interface/get_neg.cc:
Adjust dg-error line numbers.

Reviewed-by: Nathan Myers <nmyers@redhat.com>
Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
20 files changed:
libstdc++-v3/include/bits/version.def
libstdc++-v3/include/bits/version.h
libstdc++-v3/include/std/array
libstdc++-v3/include/std/bitset
libstdc++-v3/include/std/deque
libstdc++-v3/include/std/expected
libstdc++-v3/include/std/forward_list
libstdc++-v3/include/std/inplace_vector
libstdc++-v3/include/std/iterator
libstdc++-v3/include/std/list
libstdc++-v3/include/std/memory
libstdc++-v3/include/std/optional
libstdc++-v3/include/std/ranges
libstdc++-v3/include/std/span
libstdc++-v3/include/std/stacktrace
libstdc++-v3/include/std/string
libstdc++-v3/include/std/string_view
libstdc++-v3/include/std/valarray
libstdc++-v3/include/std/vector
libstdc++-v3/testsuite/23_containers/array/tuple_interface/get_neg.cc

index df7190bec487c50fc21cb2dbef882475c2a1dbd2..5dddf4cf34520db04b48d7bd29830756f12e1478 100644 (file)
@@ -2448,7 +2448,107 @@ ftms = {
   name = valarray;
   values = {
     v = 202511;
-    cxxmin = 26; 
+    cxxmin = 26;
+  };
+};
+
+ftms = {
+  name = hardened_array;
+  values = {
+    v = 202502;
+    cxxmin = 11;
+    extra_cond = "defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_basic_stacktrace;
+  values = {
+    v = 202502;
+    cxxmin = 23;
+    hosted = yes;
+    extra_cond = "defined(__glibcxx_stacktrace) && defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_basic_string;
+  values = {
+    v = 202502;
+    extra_cond = "defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_basic_string_view;
+  values = {
+    v = 202502;
+    extra_cond = "defined(__glibcxx_string_view) && defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_bitset;
+  values = {
+    v = 202502;
+    extra_cond = "defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_common_iterator;
+  values = {
+    v = 202502;
+    extra_cond = "defined(__glibcxx_ranges) && defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_counted_iterator;
+  values = {
+    v = 202502;
+    extra_cond = "defined(__glibcxx_ranges) && defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_deque;
+  values = {
+    v = 202502;
+    extra_cond = "defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_expected;
+  values = {
+    v = 202502;
+    extra_cond = "defined(__glibcxx_expected) && defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_forward_list;
+  values = {
+    v = 202502;
+    cxxmin = 11;
+    extra_cond = "defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_inplace_vector;
+  values = {
+    v = 202502;
+    extra_cond = "defined(__glibcxx_inplace_vector) && defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_list;
+  values = {
+    v = 202502;
+    extra_cond = "defined(_GLIBCXX_ASSERTIONS)";
   };
 };
 
@@ -2460,6 +2560,54 @@ ftms = {
   };
 };
 
+ftms = {
+  name = hardened_optional;
+  values = {
+    v = 202502;
+    extra_cond = "defined(__glibcxx_optional) && defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_shared_ptr_array;
+  values = {
+    v = 202502;
+    extra_cond = "defined(__glibcxx_shared_ptr_arrays) && defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_span;
+  values = {
+    v = 202502;
+    extra_cond = "defined(__glibcxx_span) && defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_valarray;
+  values = {
+    v = 202502;
+    extra_cond = "defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_vector;
+  values = {
+    v = 202502;
+    extra_cond = "defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
+ftms = {
+  name = hardened_view_interface;
+  values = {
+    v = 202502;
+    extra_cond = "defined(__glibcxx_ranges) && defined(_GLIBCXX_ASSERTIONS)";
+  };
+};
+
 // Standard test specifications.
 stds[97] = ">= 199711L";
 stds[03] = ">= 199711L";
index 1a07f11535829e074c3d6848fcfc691533924954..787315033bb82374e6c1eb0ebe15382c909a875b 100644 (file)
 #endif /* !defined(__cpp_lib_valarray) */
 #undef __glibcxx_want_valarray
 
+#if !defined(__cpp_lib_hardened_array)
+# if (__cplusplus >= 201103L) && (defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_array 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_array)
+#   define __cpp_lib_hardened_array 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_array) */
+#undef __glibcxx_want_hardened_array
+
+#if !defined(__cpp_lib_hardened_basic_stacktrace)
+# if (__cplusplus >= 202100L) && _GLIBCXX_HOSTED && (defined(__glibcxx_stacktrace) && defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_basic_stacktrace 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_basic_stacktrace)
+#   define __cpp_lib_hardened_basic_stacktrace 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_basic_stacktrace) */
+#undef __glibcxx_want_hardened_basic_stacktrace
+
+#if !defined(__cpp_lib_hardened_basic_string)
+# if (defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_basic_string 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_basic_string)
+#   define __cpp_lib_hardened_basic_string 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_basic_string) */
+#undef __glibcxx_want_hardened_basic_string
+
+#if !defined(__cpp_lib_hardened_basic_string_view)
+# if (defined(__glibcxx_string_view) && defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_basic_string_view 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_basic_string_view)
+#   define __cpp_lib_hardened_basic_string_view 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_basic_string_view) */
+#undef __glibcxx_want_hardened_basic_string_view
+
+#if !defined(__cpp_lib_hardened_bitset)
+# if (defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_bitset 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_bitset)
+#   define __cpp_lib_hardened_bitset 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_bitset) */
+#undef __glibcxx_want_hardened_bitset
+
+#if !defined(__cpp_lib_hardened_common_iterator)
+# if (defined(__glibcxx_ranges) && defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_common_iterator 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_common_iterator)
+#   define __cpp_lib_hardened_common_iterator 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_common_iterator) */
+#undef __glibcxx_want_hardened_common_iterator
+
+#if !defined(__cpp_lib_hardened_counted_iterator)
+# if (defined(__glibcxx_ranges) && defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_counted_iterator 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_counted_iterator)
+#   define __cpp_lib_hardened_counted_iterator 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_counted_iterator) */
+#undef __glibcxx_want_hardened_counted_iterator
+
+#if !defined(__cpp_lib_hardened_deque)
+# if (defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_deque 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_deque)
+#   define __cpp_lib_hardened_deque 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_deque) */
+#undef __glibcxx_want_hardened_deque
+
+#if !defined(__cpp_lib_hardened_expected)
+# if (defined(__glibcxx_expected) && defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_expected 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_expected)
+#   define __cpp_lib_hardened_expected 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_expected) */
+#undef __glibcxx_want_hardened_expected
+
+#if !defined(__cpp_lib_hardened_forward_list)
+# if (__cplusplus >= 201103L) && (defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_forward_list 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_forward_list)
+#   define __cpp_lib_hardened_forward_list 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_forward_list) */
+#undef __glibcxx_want_hardened_forward_list
+
+#if !defined(__cpp_lib_hardened_inplace_vector)
+# if (defined(__glibcxx_inplace_vector) && defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_inplace_vector 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_inplace_vector)
+#   define __cpp_lib_hardened_inplace_vector 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_inplace_vector) */
+#undef __glibcxx_want_hardened_inplace_vector
+
+#if !defined(__cpp_lib_hardened_list)
+# if (defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_list 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_list)
+#   define __cpp_lib_hardened_list 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_list) */
+#undef __glibcxx_want_hardened_list
+
 #if !defined(__cpp_lib_hardened_mdspan)
 # if (defined(__glibcxx_mdspan) && defined(_GLIBCXX_ASSERTIONS))
 #  define __glibcxx_hardened_mdspan 202502L
 #endif /* !defined(__cpp_lib_hardened_mdspan) */
 #undef __glibcxx_want_hardened_mdspan
 
+#if !defined(__cpp_lib_hardened_optional)
+# if (defined(__glibcxx_optional) && defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_optional 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_optional)
+#   define __cpp_lib_hardened_optional 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_optional) */
+#undef __glibcxx_want_hardened_optional
+
+#if !defined(__cpp_lib_hardened_shared_ptr_array)
+# if (defined(__glibcxx_shared_ptr_arrays) && defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_shared_ptr_array 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_shared_ptr_array)
+#   define __cpp_lib_hardened_shared_ptr_array 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_shared_ptr_array) */
+#undef __glibcxx_want_hardened_shared_ptr_array
+
+#if !defined(__cpp_lib_hardened_span)
+# if (defined(__glibcxx_span) && defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_span 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_span)
+#   define __cpp_lib_hardened_span 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_span) */
+#undef __glibcxx_want_hardened_span
+
+#if !defined(__cpp_lib_hardened_valarray)
+# if (defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_valarray 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_valarray)
+#   define __cpp_lib_hardened_valarray 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_valarray) */
+#undef __glibcxx_want_hardened_valarray
+
+#if !defined(__cpp_lib_hardened_vector)
+# if (defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_vector 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_vector)
+#   define __cpp_lib_hardened_vector 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_vector) */
+#undef __glibcxx_want_hardened_vector
+
+#if !defined(__cpp_lib_hardened_view_interface)
+# if (defined(__glibcxx_ranges) && defined(_GLIBCXX_ASSERTIONS))
+#  define __glibcxx_hardened_view_interface 202502L
+#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_hardened_view_interface)
+#   define __cpp_lib_hardened_view_interface 202502L
+#  endif
+# endif
+#endif /* !defined(__cpp_lib_hardened_view_interface) */
+#undef __glibcxx_want_hardened_view_interface
+
 #undef __glibcxx_want_all
index 22f6251d4fe3aa6bfab891193109a28b20e63c52..5d3edbea64959d862136ced481c230973a981dbc 100644 (file)
@@ -49,6 +49,7 @@
 
 #define __glibcxx_want_array_constexpr
 #define __glibcxx_want_freestanding_array
+#define __glibcxx_want_hardened_array
 #define __glibcxx_want_nonmember_container_access
 #define __glibcxx_want_to_array
 #include <bits/version.h>
index 64dae5be8bf9c91a3059dc1b7048f904f66404ab..a8cb337f4b15f50162f98161f5b6f1cb43c8cf53 100644 (file)
@@ -62,6 +62,7 @@
 
 #define __glibcxx_want_constexpr_bitset
 #define __glibcxx_want_bitset  // ...construct from string_view
+#define __glibcxx_want_hardened_bitset
 #include <bits/version.h>
 
 #ifdef __cpp_lib_bitset // ...construct from string_view
index 3899b68e73670b0a24e545d9b51bf21f97791d88..3b2f34fc70755ee3885d6168eed96cabbf8c9915 100644 (file)
@@ -75,6 +75,7 @@
 #define __glibcxx_want_allocator_traits_is_always_equal
 #define __glibcxx_want_containers_ranges
 #define __glibcxx_want_erase_if
+#define __glibcxx_want_hardened_deque
 #define __glibcxx_want_nonmember_container_access
 #include <bits/version.h>
 
index 21522850d7ae30c855ec63592d3ce13e7bd4e321..fe4e1ecbf0ec59759fdb5182bc6de168927c09da 100644 (file)
@@ -37,6 +37,7 @@
 #define __glibcxx_want_freestanding_expected
 #define __glibcxx_want_constrained_equality
 #define __glibcxx_want_constexpr_exceptions
+#define __glibcxx_want_hardened_expected
 #include <bits/version.h>
 
 #ifdef __cpp_lib_expected // C++ >= 23 && __cpp_concepts >= 202002L
index ff0c58455cf5384c8aff8eecc9d7f5791c872c28..e24c1573e0ad5deaeb9d138ecdb734391e4f5401 100644 (file)
@@ -51,6 +51,7 @@
 #define __glibcxx_want_allocator_traits_is_always_equal
 #define __glibcxx_want_containers_ranges
 #define __glibcxx_want_erase_if
+#define __glibcxx_want_hardened_forward_list
 #define __glibcxx_want_incomplete_container_elements
 #define __glibcxx_want_list_remove_return_type
 #define __glibcxx_want_nonmember_container_access
index caf9c2032452c9bc906db29058870d705d9dc8bb..8bd890042969b760584dfb2d395c446341b20a2b 100644 (file)
@@ -32,6 +32,7 @@
 
 #pragma GCC system_header
 
+#define __glibcxx_want_hardened_inplace_vector
 #define __glibcxx_want_inplace_vector
 #include <bits/version.h>
 
index 96696cc535933317b1adc475df435ce191f459b0..3d2dc8bbe9e4476d36ad0432bbf02adbe57330f8 100644 (file)
@@ -71,6 +71,8 @@
 
 #define __glibcxx_want_array_constexpr
 #define __glibcxx_want_constexpr_iterator
+#define __glibcxx_want_hardened_common_iterator
+#define __glibcxx_want_hardened_counted_iterator
 #define __glibcxx_want_make_reverse_iterator
 #define __glibcxx_want_move_iterator_concept
 #define __glibcxx_want_nonmember_container_access
index a3e7c81680a9a98c0bd28b7e386b55e09074324b..29d8fce698bc374cae875de355dace904de921c0 100644 (file)
@@ -75,6 +75,7 @@
 #define __glibcxx_want_allocator_traits_is_always_equal
 #define __glibcxx_want_containers_ranges
 #define __glibcxx_want_erase_if
+#define __glibcxx_want_hardened_list
 #define __glibcxx_want_incomplete_container_elements
 #define __glibcxx_want_list_remove_return_type
 #define __glibcxx_want_nonmember_container_access
index cbe9f5ad2007717c81daa765de77f630f8f889c4..9343b34973153b850f030eb0557a7c472be7c53d 100644 (file)
 #define __glibcxx_want_constexpr_dynamic_alloc
 #define __glibcxx_want_constexpr_memory
 #define __glibcxx_want_enable_shared_from_this
+#define __glibcxx_want_hardened_shared_ptr_array
 #define __glibcxx_want_indirect
 #define __glibcxx_want_is_sufficiently_aligned
 #define __glibcxx_want_make_unique
index dec1a50413abe60f952392f19954d424190c2923..221beb2446d64edd7fe83ee044e4a0b7a5085e44 100644 (file)
@@ -39,6 +39,7 @@
 #define __glibcxx_want_optional_range_support
 #define __glibcxx_want_constrained_equality
 #define __glibcxx_want_constexpr_exceptions
+#define __glibcxx_want_hardened_optional
 #include <bits/version.h>
 
 #ifdef __cpp_lib_optional // C++ >= 17
index 7d8b37f8c5cfbeca83b02c192de6c94fd4c6af05..39a50b03e457b8a35785e4f6d08d4c848a221df2 100644 (file)
@@ -56,6 +56,7 @@
 #include <bits/refwrap.h>
 
 #define __glibcxx_want_algorithm_default_value_type
+#define __glibcxx_want_hardened_view_interface
 #define __glibcxx_want_ranges
 #define __glibcxx_want_ranges_as_const
 #define __glibcxx_want_ranges_as_rvalue
index aaa7a485be8c2e908a9f6eb9d67ffa32c5bcf151..2b978dad8a4dc512372af89af0e8255fcd75ff25 100644 (file)
@@ -40,6 +40,7 @@
 
 #define __glibcxx_want_span
 #define __glibcxx_want_span_initializer_list
+#define __glibcxx_want_hardened_span
 #include <bits/version.h>
 
 #ifdef __cpp_lib_span // C++ >= 20 && concepts
index 79941d93b88f5ac69d19f7ac2f1e0fc64174cf40..22d8b804a5e904af8bb0780e6f49d3f2794021aa 100644 (file)
@@ -34,6 +34,7 @@
 
 #define __glibcxx_want_stacktrace
 #define __glibcxx_want_formatters
+#define __glibcxx_want_hardened_basic_stacktrace
 #include <bits/version.h>
 
 #ifdef __cpp_lib_stacktrace // C++ >= 23 && hosted && HAVE_STACKTRACE
index c2b37391fc7a831a29feccdce6abc835ea242968..1a622b7aebd6b549abf7363a575b16befc83aef7 100644 (file)
@@ -72,6 +72,7 @@
 #define __glibcxx_want_constexpr_string
 #define __glibcxx_want_containers_ranges
 #define __glibcxx_want_erase_if
+#define __glibcxx_want_hardened_basic_string
 #define __glibcxx_want_nonmember_container_access
 #define __glibcxx_want_string_resize_and_overwrite
 #define __glibcxx_want_string_subview
index 81b0011245b56c3baf2b6a859ee699b829b04390..ce6aee290524d5a5ae496923469f8758e63c4809 100644 (file)
@@ -40,6 +40,7 @@
 #define __glibcxx_want_constexpr_char_traits
 #define __glibcxx_want_constexpr_string_view
 #define __glibcxx_want_freestanding_string_view
+#define __glibcxx_want_hardened_basic_string_view
 #define __glibcxx_want_starts_ends_with
 #define __glibcxx_want_string_contains
 #define __glibcxx_want_string_subview
index 5a1f5c0ac5e851c9d862c9f1e35536ace74600ef..1e2254d5c72d1c9c644179f65d12918f0a353851 100644 (file)
@@ -46,6 +46,7 @@
 #include <bits/range_access.h>
 #endif
 
+#define __glibcxx_want_hardened_valarray
 #define __glibcxx_want_valarray
 #include <bits/version.h>
 
index 343483e951914241e42102749182cc3ced3ed524..86e42b22ea5bfabb3298aaac4c4a956dc7b8b6af 100644 (file)
@@ -83,6 +83,7 @@
 #define __glibcxx_want_constexpr_vector
 #define __glibcxx_want_containers_ranges
 #define __glibcxx_want_erase_if
+#define __glibcxx_want_hardened_vector
 #define __glibcxx_want_incomplete_container_elements
 #define __glibcxx_want_nonmember_container_access
 #include <bits/version.h>
index c71ddf91f645056b70ace571ed9bb6168d4bf57c..0772581226de640bc1b50118d431e67c7813e12f 100644 (file)
@@ -26,6 +26,6 @@ int n1 = std::get<1>(a);
 int n2 = std::get<1>(std::move(a));
 int n3 = std::get<1>(ca);
 
-// { dg-error "static assertion failed" "" { target *-*-* } 396 }
-// { dg-error "static assertion failed" "" { target *-*-* } 405 }
-// { dg-error "static assertion failed" "" { target *-*-* } 414 }
+// { dg-error "static assertion failed" "" { target *-*-* } 397 }
+// { dg-error "static assertion failed" "" { target *-*-* } 406 }
+// { dg-error "static assertion failed" "" { target *-*-* } 415 }