diff options
Diffstat (limited to 'libstdc++-v3')
21 files changed, 375 insertions, 118 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 03c33ab..5d54d30 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,62 @@ +2025-11-02  Jason Merrill  <jason@redhat.com> + +	* src/c++23/std.cc.in: Uncomment usings for vprint_*_buffered. + +2025-10-30  Jakub Jelinek  <jakub@redhat.com> + +	* include/bits/version.def (is_implicit_lifetime): New. +	* include/bits/version.h: Regenerate. +	* include/std/type_traits (std::is_implicit_lifetime, +	std::is_implicit_lifetime_v): New trait. +	* src/c++23/std.cc.in (std::is_implicit_lifetime, +	std::is_implicit_lifetime_v): Export. +	* testsuite/20_util/is_implicit_lifetime/version.cc: New test. +	* testsuite/20_util/is_implicit_lifetime/value.cc: New test. + +2025-10-29  Jonathan Wakely  <jwakely@redhat.com> + +	* include/bits/regex.tcc (regex_traits::value): Use __c instead +	of __ch. + +2025-10-29  Jonathan Wakely  <jwakely@redhat.com> + +	* testsuite/17_intro/headers/c++2011/42319.cc: Include <ios> +	instead of <bits/char_traits.h>. Add no_pch option. Remove +	explicit -std=gnu++11 option. +	* testsuite/30_threads/thread/swap/1.cc: Include <utility> +	instead of <bits/move.h>. + +2025-10-29  Tomasz Kamiński  <tkaminsk@redhat.com> + +	PR libstdc++/119721 +	* include/std/tuple (tuple<>::operator=(const _Tuple&) const) +	[__cpp_lib_ranges_zip]: Define. +	* testsuite/23_containers/tuple/cons/119721.cc: Test const +	assignment. + +2025-10-29  Osama Abdelkader  <osama.abdelkader@gmail.com> +	    Tomasz Kamiński  <tkaminsk@redhat.com> + +	PR libstdc++/119721 +	* include/std/tuple (tuple<>::tuple(const tuple&)) +	(tuple<>::operator=(const tuple&)): Define as defaulted. +	(tuple<>::swap): Moved the defintion after assignments. +	(tuple<>::tuple(_UTuple&&)) +	(tuple<>::tuple(allocator_arg_t, const _Alloc&, _UTuple&&)) +	(tuple<>::operator=(_UTuple&&)) [__cpp_lib_tuple_like]: Define. +	(tuple<>::operator==, tuple<>::opeator<=>): Parenthesize +	constrains individually. +	* testsuite/23_containers/tuple/cons/119721.cc: New test for +	constructors and assignments with empty tuple-like types. +	* testsuite/20_util/tuple/requirements/empty_trivial.cc: +	New test verifying tuple<> remains trivially copyable. + +2025-10-29  Jonathan Wakely  <jwakely@redhat.com> + +	* include/bits/regex.tcc (regex_traits::value): Implement +	without using istringstream. +	* include/std/regex: Do not include <sstream>. +  2025-10-28  Jonathan Wakely  <jwakely@redhat.com>  	PR libstdc++/122401 diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 5302780..420391e 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -7118,15 +7118,7 @@ rm -f conftest*  fi  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5  $as_echo "$clang_cv_is_clang" >&6; } -  plugin_file= -  if test $clang_cv_is_clang = yes; then -    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5 -$as_echo_n "checking for clang plugin file... " >&6; } -    plugin_names="LLVMgold.so" -    for plugin in $plugin_names; do -      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin` -      if test x$plugin_file = x$plugin; then -	if test -n "$ac_tool_prefix"; then +  if test -n "$ac_tool_prefix"; then    # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args.  set dummy ${ac_tool_prefix}llvm-config; ac_word=$2  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -7218,22 +7210,31 @@ else    LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG"  fi -	if test "$?" != 0; then -	  as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5 -	fi -	clang_lib_dir=`$LLVM_CONFIG --libdir` -	if test -f $clang_lib_dir/$plugin; then -	  plugin_file=$clang_lib_dir/$plugin -	fi -	if test x$plugin_file != x$plugin; then +  plugin_file= +  if test $clang_cv_is_clang = yes; then +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5 +$as_echo_n "checking for clang plugin file... " >&6; } +    plugin_names="LLVMgold.so" +    for plugin in $plugin_names; do +      plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin` +      if test "$plugin_file" != "$plugin"; then +	break; +      fi +      if test -n "${LLVM_CONFIG}"; then +	plugin_file=`${LLVM_CONFIG} --libdir`/$plugin +	if test -f "$plugin_file"; then  	  break;  	fi        fi +      plugin_file=      done -    if test -z $plugin_file; then -      as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5 -    fi -        if test -n "$ac_tool_prefix"; then +    if test -z "$plugin_file"; then +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +    else +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5 +$as_echo "$plugin_file" >&6; } +            if test -n "$ac_tool_prefix"; then    # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.  set dummy ${ac_tool_prefix}ar; ac_word=$2  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -7325,42 +7326,26 @@ else    AR="$ac_cv_prog_AR"  fi -    if test "${AR}" = "" ; then -      as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 -    fi -    plugin_option="--plugin $plugin_file" -    touch conftest.c -    ${AR} $plugin_option rc conftest.a conftest.c -    if test "$?" != 0; then -      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 +      if test -z "${AR}"; then +	as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 +      fi +      plugin_option="--plugin $plugin_file" +      touch conftest.c +      ${AR} $plugin_option rc conftest.a conftest.c +      if test "$?" != 0; then +	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5  $as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} -      plugin_file= +	plugin_file= +      fi +      rm -f conftest.*      fi -    rm -f conftest.* -    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5 -$as_echo "$plugin_file" >&6; }    fi    plugin_file="$plugin_file"  if test -n "$plugin_file"; then    plugin_option="--plugin $plugin_file"  else -  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 -$as_echo_n "checking for -plugin option... " >&6; } - -plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" -plugin_option= -for plugin in $plugin_names; do -  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` -  if test x$plugin_so = x$plugin; then -    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` -  fi -  if test x$plugin_so != x$plugin; then -    plugin_option="--plugin $plugin_so" -    break -  fi -done -if test -n "$ac_tool_prefix"; then +  if test -n "$ac_tool_prefix"; then    # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.  set dummy ${ac_tool_prefix}ar; ac_word=$2  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -7452,25 +7437,39 @@ else    AR="$ac_cv_prog_AR"  fi -if test "${AR}" = "" ; then +if test -z "${AR}"; then    as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5  fi -touch conftest.c -${AR} $plugin_option rc conftest.a conftest.c -if test "$?" != 0; then -  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 -$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} -  plugin_option= -fi -rm -f conftest.* -if test -n "$plugin_option"; then -  plugin_option="$plugin_option" -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5 -$as_echo "$plugin_option" >&6; } -else +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 +$as_echo_n "checking for -plugin option... " >&6; } +plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +plugin_option= +for plugin in $plugin_names; do +  plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` +  if test x$plugin_so = x$plugin; then +    plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` +  fi +  if test x$plugin_so != x$plugin; then +    plugin_option="--plugin $plugin_so" +    break +  fi +done +if test -z "$plugin_option"; then    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5  $as_echo "no" >&6; } +else +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5 +$as_echo "$plugin_option" >&6; } +    touch conftest.c +  ${AR} $plugin_option rc conftest.a conftest.c +  if test "$?" != 0; then +    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 +$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} +    plugin_option= +  fi +  rm -f conftest.*  fi +plugin_option="$plugin_option"  fi  if test -n "$ac_tool_prefix"; then @@ -12655,7 +12654,7 @@ else    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2    lt_status=$lt_dlunknown    cat > conftest.$ac_ext <<_LT_EOF -#line 12658 "configure" +#line 12657 "configure"  #include "confdefs.h"  #if HAVE_DLFCN_H @@ -12761,7 +12760,7 @@ else    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2    lt_status=$lt_dlunknown    cat > conftest.$ac_ext <<_LT_EOF -#line 12764 "configure" +#line 12763 "configure"  #include "confdefs.h"  #if HAVE_DLFCN_H @@ -16423,7 +16422,7 @@ $as_echo "$glibcxx_cv_atomic_word" >&6; }      # Fake what AC_TRY_COMPILE does.      cat > conftest.$ac_ext << EOF -#line 16426 "configure" +#line 16425 "configure"  #include "${glibcxx_srcdir}/config/$atomic_word_dir/atomic_word.h"  int main()  { @@ -16569,7 +16568,7 @@ $as_echo "mutex" >&6; }    # unnecessary for this test.      cat > conftest.$ac_ext << EOF -#line 16572 "configure" +#line 16571 "configure"  int main()  {    _Decimal32 d1; @@ -16611,7 +16610,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu    # unnecessary for this test.    cat > conftest.$ac_ext << EOF -#line 16614 "configure" +#line 16613 "configure"  template<typename T1, typename T2>    struct same    { typedef T2 type; }; @@ -53941,7 +53940,7 @@ $as_echo "$glibcxx_cv_libbacktrace_atomics" >&6; }      CXXFLAGS='-O0 -S'      cat > conftest.$ac_ext << EOF -#line 53944 "configure" +#line 53943 "configure"  #include <stddef.h>  int main()  { diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h index b94b2cd..adc2982 100644 --- a/libstdc++-v3/include/bits/ios_base.h +++ b/libstdc++-v3/include/bits/ios_base.h @@ -56,7 +56,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION    // as permitted (but not required) in the standard, in order to provide    // better type safety in iostream calls.  A side effect is that in C++98    // expressions involving them are not compile-time constants. -  enum _Ios_Fmtflags +  enum __attribute__((__flag_enum__)) _Ios_Fmtflags      {        _S_boolalpha 	= 1L << 0,        _S_dec 		= 1L << 1, @@ -76,9 +76,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION        _S_adjustfield 	= _S_left | _S_right | _S_internal,        _S_basefield 	= _S_dec | _S_oct | _S_hex,        _S_floatfield 	= _S_scientific | _S_fixed, -      _S_ios_fmtflags_end = 1L << 16, -      _S_ios_fmtflags_max = __INT_MAX__, -      _S_ios_fmtflags_min = ~__INT_MAX__ +      _S_ios_fmtflags_end __attribute__((__unused__)) = 1L << 16, +      _S_ios_fmtflags_max __attribute__((__unused__)) = __INT_MAX__, +      _S_ios_fmtflags_min __attribute__((__unused__)) = ~__INT_MAX__      };    _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR @@ -176,15 +176,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION    { return __a = __a ^ __b; } -  enum _Ios_Iostate +  enum __attribute__((__flag_enum__)) _Ios_Iostate      {        _S_goodbit 		= 0,        _S_badbit 		= 1L << 0,        _S_eofbit 		= 1L << 1,        _S_failbit		= 1L << 2, -      _S_ios_iostate_end = 1L << 16, -      _S_ios_iostate_max = __INT_MAX__, -      _S_ios_iostate_min = ~__INT_MAX__ +      _S_ios_iostate_end __attribute__((__unused__)) = 1L << 16, +      _S_ios_iostate_max __attribute__((__unused__)) = __INT_MAX__, +      _S_ios_iostate_min __attribute__((__unused__)) = ~__INT_MAX__      };    _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR @@ -228,7 +228,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION        _S_beg = 0,        _S_cur = _GLIBCXX_STDIO_SEEK_CUR,        _S_end = _GLIBCXX_STDIO_SEEK_END, -      _S_ios_seekdir_end = 1L << 16 +      _S_ios_seekdir_end __attribute__((__unused__)) = 1L << 16      };  #if __cplusplus >= 201103L diff --git a/libstdc++-v3/include/bits/quoted_string.h b/libstdc++-v3/include/bits/quoted_string.h index 3a828d5..9a51aa3 100644 --- a/libstdc++-v3/include/bits/quoted_string.h +++ b/libstdc++-v3/include/bits/quoted_string.h @@ -61,6 +61,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION  	_Quoted_string&  	operator=(_Quoted_string&) = delete; +	// Friends for ADL with module std. +	template<typename _CharT2, typename _Traits> +	friend std::basic_ostream<_CharT2, _Traits>& +	operator<<(std::basic_ostream<_CharT2, _Traits>& __os, +		   const _Quoted_string<const _CharT2*, _CharT2>& __str); + +	template<typename _CharT2, typename _Traits, typename _String2> +	friend std::basic_ostream<_CharT2, _Traits>& +	operator<<(std::basic_ostream<_CharT2, _Traits>& __os, +		   const _Quoted_string<_String2, _CharT2>& __str); + +	template<typename _CharT2, typename _Traits, typename _Alloc> +	friend std::basic_istream<_CharT2, _Traits>& +	operator>>(std::basic_istream<_CharT2, _Traits>& __is, +		   const _Quoted_string<basic_string<_CharT2, _Traits, _Alloc>&, +		   _CharT2>& __str); +  	_String _M_string;  	_CharT _M_delim;  	_CharT _M_escape; @@ -78,6 +95,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION  	_Quoted_string&  	operator=(_Quoted_string&) = delete; +	// Friend for ADL with module std. +	template<typename _CharT2, typename _Traits2, typename _String2> +	friend std::basic_ostream<_CharT2, _Traits2>& +	operator<<(std::basic_ostream<_CharT2, _Traits2>& __os, +		   const _Quoted_string<_String2, _CharT2>& __str); +  	basic_string_view<_CharT, _Traits> _M_string;  	_CharT _M_delim;  	_CharT _M_escape; diff --git a/libstdc++-v3/include/bits/regex.tcc b/libstdc++-v3/include/bits/regex.tcc index a0edf27..48917cd 100644 --- a/libstdc++-v3/include/bits/regex.tcc +++ b/libstdc++-v3/include/bits/regex.tcc @@ -348,11 +348,11 @@ namespace __detail  	{  	  const char __c = static_cast<char>(__ch);  	  const char __max_digit = __radix == 8 ? '7' : '9'; -	  if ('0' <= __ch && __ch <= __max_digit) -	    return __ch - '0'; +	  if ('0' <= __c && __c <= __max_digit) +	    return __c - '0';  	  if (__radix < 16)  	    return -1; -	  switch (__ch) +	  switch (__c)  	  {  	    case 'a':  	    case 'A': diff --git a/libstdc++-v3/include/bits/version.def b/libstdc++-v3/include/bits/version.def index 1bf98f7..29ecf15 100644 --- a/libstdc++-v3/include/bits/version.def +++ b/libstdc++-v3/include/bits/version.def @@ -2191,6 +2191,15 @@ ftms = {    };  }; +ftms = { +  name = is_implicit_lifetime; +  values = { +    v =  202302; +    cxxmin = 23; +    extra_cond = "__has_builtin(__builtin_is_implicit_lifetime)"; +  }; +}; +  // Standard test specifications.  stds[97] = ">= 199711L";  stds[03] = ">= 199711L"; diff --git a/libstdc++-v3/include/bits/version.h b/libstdc++-v3/include/bits/version.h index 66de8b4..5901d27 100644 --- a/libstdc++-v3/include/bits/version.h +++ b/libstdc++-v3/include/bits/version.h @@ -2455,4 +2455,14 @@  #endif /* !defined(__cpp_lib_philox_engine) */  #undef __glibcxx_want_philox_engine +#if !defined(__cpp_lib_is_implicit_lifetime) +# if (__cplusplus >= 202100L) && (__has_builtin(__builtin_is_implicit_lifetime)) +#  define __glibcxx_is_implicit_lifetime 202302L +#  if defined(__glibcxx_want_all) || defined(__glibcxx_want_is_implicit_lifetime) +#   define __cpp_lib_is_implicit_lifetime 202302L +#  endif +# endif +#endif /* !defined(__cpp_lib_is_implicit_lifetime) */ +#undef __glibcxx_want_is_implicit_lifetime +  #undef __glibcxx_want_all diff --git a/libstdc++-v3/include/precompiled/stdc++.h b/libstdc++-v3/include/precompiled/stdc++.h index 636632a..54baed4 100644 --- a/libstdc++-v3/include/precompiled/stdc++.h +++ b/libstdc++-v3/include/precompiled/stdc++.h @@ -29,9 +29,7 @@  // 17.4.1.2 Headers  // C -#ifndef _GLIBCXX_NO_ASSERT -#include <cassert> -#endif +// Don't include cassert, it's not suitable for PCH or header unit.  #include <cctype>  #include <cfloat>  #include <climits> @@ -104,9 +102,6 @@  #if _GLIBCXX_HOSTED  // C -#ifndef _GLIBCXX_NO_ASSERT -#include <cassert> -#endif  #include <cctype>  #include <cerrno>  #include <cfloat> diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 77ebb7e..d28b0773 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -47,6 +47,7 @@  #define __glibcxx_want_is_aggregate  #define __glibcxx_want_is_constant_evaluated  #define __glibcxx_want_is_final +#define __glibcxx_want_is_implicit_lifetime  #define __glibcxx_want_is_invocable  #define __glibcxx_want_is_layout_compatible  #define __glibcxx_want_is_nothrow_convertible @@ -4053,6 +4054,22 @@ template<typename _Ret, typename _Fn, typename... _Args>  # endif  #endif +#ifdef __cpp_lib_is_implicit_lifetime // C++ >= 23 +  /// True if the type is an implicit-lifetime type. +  /// @since C++23 + +  template<typename _Tp> +    struct is_implicit_lifetime +    : bool_constant<__builtin_is_implicit_lifetime(_Tp)> +    { }; + +  /// @ingroup variable_templates +  /// @since C++23 +  template<typename _Tp> +    inline constexpr bool is_implicit_lifetime_v +      = __builtin_is_implicit_lifetime(_Tp); +#endif +  #ifdef __cpp_lib_reference_from_temporary // C++ >= 23 && ref_{converts,constructs}_from_temp    /// True if _Tp is a reference type, a _Up value can be bound to _Tp in    /// direct-initialization, and a temporary object would be bound to diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h index f673a33..76482db 100644 --- a/libstdc++-v3/libsupc++/exception_ptr.h +++ b/libstdc++-v3/libsupc++/exception_ptr.h @@ -214,6 +214,10 @@ namespace std _GLIBCXX_VISIBILITY(default)        { return __x._M_exception_object != __y._M_exception_object; }  #endif +      // Friend for ADL with module std. +      friend _GLIBCXX26_CONSTEXPR void +      swap(exception_ptr& __lhs, exception_ptr& __rhs); +        const class std::type_info*        __cxa_exception_type() const _GLIBCXX_USE_NOEXCEPT  	__attribute__ ((__pure__)); diff --git a/libstdc++-v3/src/c++23/std.cc.in b/libstdc++-v3/src/c++23/std.cc.in index 4c11b1b..27d83f1 100644 --- a/libstdc++-v3/src/c++23/std.cc.in +++ b/libstdc++-v3/src/c++23/std.cc.in @@ -23,11 +23,14 @@  module; +#include <bits/stdc++.h> +  // stdc++.h doesn't include <execution> because of TBB issues;  // FIXME for now let's avoid the problem by suppressing TBB. -#define _GLIBCXX_USE_TBB_PAR_BACKEND 0 - -#include <bits/stdc++.h> +#ifdef _PSTL_PAR_BACKEND_TBB +#undef _PSTL_PAR_BACKEND_TBB +#define _PSTL_PAR_BACKEND_SERIAL +#endif  #include <execution>  // Module std does include deprecated library interfaces. @@ -2185,9 +2188,9 @@ export namespace std    using std::print;    using std::println;    using std::vprint_unicode; -  //FIXME using std::vprint_unicode_buffered; +  using std::vprint_unicode_buffered;    using std::vprint_nonunicode; -  //FIXME using std::vprint_nonunicode_buffered; +  using std::vprint_nonunicode_buffered;  }  #endif @@ -3230,6 +3233,10 @@ export namespace std    using std::is_scoped_enum;    using std::is_scoped_enum_v;  #endif +#if __cpp_lib_is_implicit_lifetime +  using std::is_implicit_lifetime; +  using std::is_implicit_lifetime_v; +#endif  }  // <typeindex> diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++_assert_neg.cc b/libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++_assert_neg.cc index eb380c4..7ce90a2 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++_assert_neg.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++_assert_neg.cc @@ -1,8 +1,5 @@  // { dg-do compile } -// { dg-options "-D_GLIBCXX_NO_ASSERT" }  // { dg-require-effective-target hosted } -// NB: This is done to force any generated and possibly included PCH -// to be invalid, and also to remove cassert from the include set.  // 2005-05-24 bkoz diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc index cd576ca..350a548 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc @@ -1,5 +1,5 @@  // { dg-do compile } -// { dg-options "-std=gnu++11" } +// { dg-add-options no_pch }  // Copyright (C) 2009-2025 Free Software Foundation, Inc.  // @@ -19,4 +19,4 @@  // <http://www.gnu.org/licenses/>.  // libstdc++/42319 -#include <bits/char_traits.h> +#include <ios> diff --git a/libstdc++-v3/testsuite/20_util/is_implicit_lifetime/value.cc b/libstdc++-v3/testsuite/20_util/is_implicit_lifetime/value.cc new file mode 100644 index 0000000..d8cb181 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_implicit_lifetime/value.cc @@ -0,0 +1,129 @@ +// Copyright (C) 2025 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library.  This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3.  If not see +// <http://www.gnu.org/licenses/>. + +// { dg-do compile { target c++23 } } +// { dg-add-options no_pch } + +#include <type_traits> + +#ifndef __cpp_lib_is_implicit_lifetime +# error "Feature test macro for is_implicit_lifetime is missing in <type_traits>" +#elif __cpp_lib_is_implicit_lifetime < 202302L +# error "Feature test macro for is_implicit_lifetime has wrong value in <type_traits>" +#endif + +#include <testsuite_tr1.h> + +template<typename T> +  concept Is_implicit_lifetime +    = __gnu_test::test_category<std::is_implicit_lifetime, T>(true); + +static_assert( ! Is_implicit_lifetime<void> ); +static_assert( ! Is_implicit_lifetime<const void> ); +static_assert( ! Is_implicit_lifetime<volatile void> ); +static_assert( Is_implicit_lifetime<char> ); +static_assert( Is_implicit_lifetime<signed char> ); +static_assert( Is_implicit_lifetime<const unsigned char> ); +static_assert( Is_implicit_lifetime<short> ); +static_assert( Is_implicit_lifetime<volatile unsigned short> ); +static_assert( Is_implicit_lifetime<int> ); +static_assert( Is_implicit_lifetime<unsigned int> ); +static_assert( Is_implicit_lifetime<const volatile long> ); +static_assert( Is_implicit_lifetime<unsigned long> ); +static_assert( Is_implicit_lifetime<long long> ); +static_assert( Is_implicit_lifetime<unsigned long long> ); +static_assert( Is_implicit_lifetime<float> ); +static_assert( Is_implicit_lifetime<double> ); +static_assert( Is_implicit_lifetime<long double volatile> ); +enum W { W1 }; +static_assert( Is_implicit_lifetime<W> ); +enum class X : int { X1 }; +static_assert( Is_implicit_lifetime<const volatile X> ); +static_assert( Is_implicit_lifetime<int *> ); +static_assert( Is_implicit_lifetime<int (*) (int)> ); +struct Y { int g; int foo (int); }; +static_assert( Is_implicit_lifetime<int (Y::*)> ); +static_assert( Is_implicit_lifetime<int (Y::*) (int)> ); +static_assert( ! Is_implicit_lifetime<int &> ); +static_assert( ! Is_implicit_lifetime<char &&> ); +static_assert( Is_implicit_lifetime<int []> ); +static_assert( Is_implicit_lifetime<int [1]> ); +static_assert( Is_implicit_lifetime<const Y [42]> ); +static_assert( ! Is_implicit_lifetime<int ()> ); +static_assert( ! Is_implicit_lifetime<int () &> ); +static_assert( ! Is_implicit_lifetime<int () const> ); +static_assert( ! Is_implicit_lifetime<int (&) ()> ); +struct Z; +static_assert( Is_implicit_lifetime<Z []> ); +static_assert( Is_implicit_lifetime<Z [5]> ); +struct A { int a, b, c; }; +static_assert( Is_implicit_lifetime<A> ); +class B { static int a; private: static int b; public: int c; }; +static_assert( Is_implicit_lifetime<B> ); +struct C { C () {} int a, b, c; }; +static_assert( Is_implicit_lifetime<C> ); +struct D { explicit D (int) {} int a, b, c; }; +static_assert( Is_implicit_lifetime<D> ); +struct E : public A { int d, e, f; }; +static_assert( Is_implicit_lifetime<E> ); +struct F : public C { using C::C; int d, e, f; }; +static_assert( Is_implicit_lifetime<F> ); +class G { int a, b; }; +static_assert( Is_implicit_lifetime<G> ); +struct H { private: int a, b; }; +static_assert( Is_implicit_lifetime<H> ); +struct I { protected: int a, b; }; +static_assert( Is_implicit_lifetime<I> ); +struct J { int a, b; void foo (); }; +static_assert( Is_implicit_lifetime<J> ); +struct K { int a, b; virtual void foo (); }; +static_assert( ! Is_implicit_lifetime<K> ); +struct L : virtual public A { int d, e; }; +static_assert( ! Is_implicit_lifetime<L> ); +struct M : protected A { int d, e; }; +static_assert( Is_implicit_lifetime<M> ); +struct N : private A { int d, e; }; +static_assert( Is_implicit_lifetime<N> ); +struct O { O () = delete; int a, b, c; }; +static_assert( Is_implicit_lifetime<O> ); +struct P { P () = default; int a, b, c; }; +static_assert( Is_implicit_lifetime<P> ); +struct Q { Q (); Q (const Q &); int a, b, c; }; +static_assert( ! Is_implicit_lifetime<Q> ); +struct R { R (); R (const R &); R (R &&) = default; int a, b, c; }; +static_assert( Is_implicit_lifetime<R> ); +struct S { S (); ~S (); int a, b, c; }; +static_assert( ! Is_implicit_lifetime<S> ); +static_assert( Is_implicit_lifetime<S [3]> ); +struct T { T (); ~T () = default; int a, b, c; }; +static_assert( Is_implicit_lifetime<T> ); +struct U { U (); U (const U &) = default; int a, b, c; }; +static_assert( Is_implicit_lifetime<U> ); +struct V { V () = default; V (const V &); int a, b, c; }; +static_assert( Is_implicit_lifetime<V> ); +struct AA { Q a; Q b; }; +static_assert( Is_implicit_lifetime<AA> ); +struct AB { Q a; Q b; ~AB () = default; }; +static_assert( Is_implicit_lifetime<AB> ); +struct AC { Q a; Q b; ~AC () {} }; +static_assert( ! Is_implicit_lifetime<AC> ); +struct AD : public Q {}; +static_assert( Is_implicit_lifetime<AD> ); +struct AE : public Q { ~AE () = default; }; +static_assert( Is_implicit_lifetime<AE> ); +struct AF : public Q { ~AF () {} }; +static_assert( ! Is_implicit_lifetime<AF> ); diff --git a/libstdc++-v3/testsuite/20_util/is_implicit_lifetime/version.cc b/libstdc++-v3/testsuite/20_util/is_implicit_lifetime/version.cc new file mode 100644 index 0000000..ed90b47 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_implicit_lifetime/version.cc @@ -0,0 +1,27 @@ +// Copyright (C) 2025 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library.  This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3.  If not see +// <http://www.gnu.org/licenses/>. + +// { dg-do compile { target c++23 } } +// { dg-add-options no_pch } + +#include <version> + +#ifndef __cpp_lib_is_implicit_lifetime +# error "Feature test macro for is_implicit_lifetime is missing in <version>" +#elif __cpp_lib_is_implicit_lifetime < 202302L +# error "Feature test macro for is_implicit_lifetime has wrong value in <version>" +#endif diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/case_label.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/case_label.cc index c72e00f..6f0390b 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/case_label.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/case_label.cc @@ -68,12 +68,6 @@ case_labels(bitmask_type b)        break;      case std::ios_base::floatfield:        break; -    case std::_S_ios_fmtflags_end: -      break; -    case __INT_MAX__: -      break; -    case ~__INT_MAX__: -      break;      }    using underlying_type = std::underlying_type<bitmask_type>::type;    static_assert( sizeof(underlying_type) == sizeof(int), diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/case_label.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/case_label.cc index 6a1dd90..410f746 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/case_label.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/case_label.cc @@ -40,12 +40,6 @@ case_labels(bitmask_type b)        break;      case std::ios_base::failbit:        break; -    case std::_S_ios_iostate_end: -      break; -    case __INT_MAX__: -      break; -    case ~__INT_MAX__: -      break;      }    using underlying_type = std::underlying_type<bitmask_type>::type;    static_assert( sizeof(underlying_type) == sizeof(int), diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/case_label.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/case_label.cc index e132070..44b84a9 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/case_label.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/case_label.cc @@ -48,12 +48,6 @@ case_labels(bitmask_type b)      case std::ios_base::noreplace:        break;  #endif -    case std::_S_ios_openmode_end: -      break; -    case __INT_MAX__: -      break; -    case ~__INT_MAX__: -      break;      }    using underlying_type = std::underlying_type<bitmask_type>::type;    static_assert( sizeof(underlying_type) == sizeof(int), diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/seekdir/case_label.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/seekdir/case_label.cc index c7b9817..2dd1560 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base/types/seekdir/case_label.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/seekdir/case_label.cc @@ -38,7 +38,5 @@ case_labels(test_type b)        break;      case std::ios_base::end:        break; -    case std::_S_ios_fmtflags_end: -      break;      }  } diff --git a/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc b/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc index 9616b15..b1fde09 100644 --- a/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc +++ b/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc @@ -23,7 +23,7 @@  #include <thread>  #include <system_error> -#include <bits/move.h> // std::move +#include <utility> // std::move  #include <testsuite_hooks.h>  void f() { } diff --git a/libstdc++-v3/testsuite/util/exception/safety.h b/libstdc++-v3/testsuite/util/exception/safety.h index 8226c17..c62394c 100644 --- a/libstdc++-v3/testsuite/util/exception/safety.h +++ b/libstdc++-v3/testsuite/util/exception/safety.h @@ -24,6 +24,7 @@  #include <ext/throw_allocator.h>  #include <cstdlib> // getenv, atoi  #include <cstdio>  // printf, fflush +#include <cassert> // assert  // Container requirement testing.  namespace __gnu_test  | 
