Commit Graph

13384 Commits

Author SHA1 Message Date
GCC Administrator
3d9439b1bb Daily bump. 2022-05-18 00:16:36 +00:00
Jonathan Wakely
ddb1427def libstdc++: Relax memory ordering for default memory resource object
Currently pmr::set_default_resource and pmr::get_default_resource both
use sequentially consistent memory ordering. This is overkill. The
standard only requires that a call to set_default_resource synchronizes
with subsequent calls to set_default_resource and get_default_resource.

Using acquire-release for the setter and acquire for the getter is
sufficient to meet the requirement.

Reviewed-by: Thomas Rodgers  <trodgers@redhat.com>

libstdc++-v3/ChangeLog:

	* src/c++17/memory_resource.cc (set_default_resource): Use
	memory_order_acq_rel.
	(get_default_resource): Use memory_order_acquire.
2022-05-17 20:53:40 +01:00
Jonathan Wakely
5c2d703e6d libstdc++: Add attributes to functions in <memory_resource>
Add attributes to the accessors for the global memory resource objects,
to allow the compiler to eliminate redundant calls to them. For example,
multiple calls to std::pmr::new_delete_resource() will always return the
same object, and so the compiler can replace them with a single call.

Ideally we would like adjacent calls to std::pmr::get_default_resource()
to be combined into a single call by the CSE pass. The 'pure' attribute
would permit that. However, the standard requires that calls to
std::pmr::set_default_resource() synchronize with subsequent calls to
std::pmr::get_default_resource().  With 'pure' the DCE pass might
eliminate seemingly redundant calls to std::pmr::get_default_resource().
That might be unsafe, because the caller might be relying on the
associated synchronization. We could use a hypothetical attribute that
allows CSE but not DCE, but we don't have one. So it can't be 'pure'.

Also add [[nodiscard]] to equality operators.

libstdc++-v3/ChangeLog:

	* include/std/memory_resource (new_delete_resource): Add
	nodiscard, returns_nonnull and const attributes.
	(null_memory_resource): Likewise.
	(set_default_resource, get_default_resource): Add returns_nonnull
	attribute.
	(memory_resource::is_equal): Add nodiscard attribute.
	(operator==, operator!=): Likewise.
2022-05-17 20:51:04 +01:00
Jonathan Wakely
5f1ce85135 libstdc++: Add attributes to <system_error> and related
Add the const attribute to std::future_category() and
std::iostream_category(), to match the existing attributes on
std::generic_category() and std::system_category().

Also add [[nodiscard]] to those functions and to the comparison
operators for std::error_code and std::error_condition, and to
std::make_error_code and std::make_error_condition overloads.

libstdc++-v3/ChangeLog:

	* include/bits/ios_base.h (io_category): Add const and nodiscard
	attributes.
	(make_error_code, make_error_condition): Add nodiscard.
	* include/std/future (future_category): Add const and nodiscard.
	(make_error_code, make_error_condition): Add nodiscard.
	* include/std/system_error (generic_category system_category):
	Add nodiscard. Replace _GLIBCXX_CONST with C++11 attribute.
	(error_code::value, error_code::category, error_code::operator bool)
	(error_condition::value, error_condition::category)
	(error_condition::operator bool, make_error_code)
	(make_error_condition, operator==, operator!=, operator<=>): Add
	nodiscard.
2022-05-17 20:50:31 +01:00
Jonathan Wakely
1815462a6e libstdc++: Skip tests that fail for the versioned namespace
Most tests for the contents of header synopses need to be supressed for
the versioned namespace build, because redeclaring the entities in std
fails when they were originally declared in std::__8.

I added these tests recently without the suppression, so they fail.

libstdc++-v3/ChangeLog:

	* testsuite/20_util/expected/synopsis.cc: Skip for versioned
	namespace.
	* testsuite/27_io/headers/iosfwd/synopsis.cc: Likewise.
2022-05-17 11:42:34 +01:00
Jonathan Wakely
357d6fcd41 libstdc++: Stop defining C++0x compat symbols for versioned namespace
The src/c++11/compatibility*-c++0x.cc files define symbols that need to
be exported for ancient versions of libstdc++.so.6 due to changes
between C++0x and the final C++11 standard. Those symbols are not needed
in the libstdc++.so.8 library, and we can skip building them entirely.

This also fixes the build failure I introduced last week when making the
versioned namespace config not use the _V2 namespace for compat symbols.

libstdc++-v3/ChangeLog:

	* src/Makefile.am [ENABLE_SYMVERS_GNU_NAMESPACE] (cxx11_sources):
	Do not build the compatibility*-c++0x.cc objects.
	* src/Makefile.in: Regenerate.
	* src/c++11/compatibility-c++0x.cc [_GLIBCXX_INLINE_VERSION]:
	Refuse to build for the versioned namespace.
	* src/c++11/compatibility-chrono.cc: Likewise.
	* src/c++11/compatibility-condvar.cc: Likewise.
	* src/c++11/compatibility-thread-c++0x.cc: Likewise.
	* src/c++11/chrono.cc (system_clock, steady_clock):
	Use macros to define in inline namespace _V2, matching the
	declarations in <system_error>.
	* src/c++11/system_error.cc (system_category, generic_category):
	Likewise.
2022-05-17 11:42:34 +01:00
GCC Administrator
702bd11fa7 Daily bump. 2022-05-17 00:16:28 +00:00
Jonathan Wakely
682e587f10 libstdc++: Fix hyperlink in docs
libstdc++-v3/ChangeLog:

	* doc/xml/manual/prerequisites.xml: Fix attributes for external
	hyperlink.
	* doc/html/manual/setup.html: Regenerate.
2022-05-16 14:54:07 +01:00
Jonathan Wakely
8414dad54a libstdc++: Update C++23 status docs
These are the C++23 proposals supported in the gcc-12 branch.

libstdc++-v3/ChangeLog:

	* doc/xml/manual/status_cxx2023.xml: Update with gcc-12 support.
	* doc/html/*: Regenerate.
2022-05-16 14:53:16 +01:00
Jonathan Wakely
4361867344 libstdc++: Add C++23 status docs
These are the C++23 proposals already supported in the gcc-11 branch.

libstdc++-v3/ChangeLog:

	* doc/xml/manual/intro.xml: Include new chapter.
	* doc/xml/manual/status_cxx2020.xml: Tweak release numbers.
	* doc/xml/manual/status_cxx2023.xml: New file.
	* doc/html/*: Regenerate.
2022-05-16 14:47:34 +01:00
Jonathan Wakely
64648821f1 libstdc++: Fix status docs for <bit> support
libstdc++-v3/ChangeLog:

	* doc/html/manual/status.html: Regenerate.
	* doc/xml/manual/status_cxx2020.xml: Fix supported version for
	C++20 bit operations.
2022-05-16 14:47:34 +01:00
GCC Administrator
9df4ffe493 Daily bump. 2022-05-14 00:17:19 +00:00
Jonathan Wakely
7f40ac326a libstdc++: Make std:🧵:_State private
* include/bits/std_thread.h (thread::_State, thread::_State_ptr):
	Declare as private unless _GLIBCXX_THREAD_IMPL is defined.
	* src/c++11/thread.cc (_GLIBCXX_THREAD_IMPL): Define.
2022-05-13 20:40:05 +01:00
Jonathan Wakely
8659bcd6b7 libstdc++: Add noexcept to std::launch operators
libstdc++-v3/ChangeLog:

	* include/std/future (launch): Make operators noexcept.
2022-05-13 20:40:05 +01:00
Jonathan Wakely
c829b04bc3 libstdc++: Allow std::swap to find overload for std::exception_ptr
The non-member swap for std::exception_ptr is in a nested namespace and
so can only be found by ADL currently. Add a using-declaration so that
qualified std::swap calls will use the std::exception_ptr::swap member,
instead of the generic std::swap.

There's no new test for this, because the generic std::swap works, it
just does more work than is necessary.

Also tell Doxygen to replace the __exception_ptr namespace with
"__unspecified__" in the generate docs, so the real name is not
documented.

libstdc++-v3/ChangeLog:

	* doc/doxygen/user.cfg.in (PREDEFINED): Replace __exception_ptr
	with "__unspecified__".
	* libsupc++/exception_ptr.h: Improve doxygen docs.
	(__exception_ptr::swap): Also declare in namespace std.
2022-05-13 20:40:04 +01:00
Jonathan Wakely
c470f3ea86 libstdc++: Make std::rethrow_if_nested work without RTTI
This allows std::rethrow_if_nested to work with -fno-rtti by not
attempting the dynamic_cast if it requires RTTI, since that's ill-formed
with -fno-rtti. The cast will still work if a static upcast to
std::nested_exception is allowed.

Also use if-constexpr to avoid the compile-time overload resolution (and
SFINAE) and run-time dispatching for std::rethrow_if_nested and
std::throw_with_nested.

Also add better doxygen comments throughout the file.

libstdc++-v3/ChangeLog:

	* libsupc++/nested_exception.h (throw_with_nested) [C++17]: Use
	if-constexpr instead of tag dispatching.
	(rethrow_if_nested) [C++17]: Likewise.
	(rethrow_if_nested) [!__cpp_rtti]: Do not use dynamic_cast if it
	would require RTTI.
	* testsuite/18_support/nested_exception/rethrow_if_nested-term.cc:
	New test.
2022-05-13 20:39:59 +01:00
Jonathan Wakely
b584cbdb08 libstdc++: Improve doxygen docs for <mutex>
libstdc++-v3/ChangeLog:

	* doc/doxygen/user.cfg.in (PREDEFINED): Define
	_GTHREAD_USE_MUTEX_TIMEDLOCK macro.
	* include/bits/std_mutex.h (mutex, lock_guard): Use @since and
	@headerfile.
	* include/bits/unique_lock.h (unique_lock): Likewise.
	* include/std/mutex (recursive_mutex, timed_mutex)
	(recursive_timed_mutex, scoped_lock): Likewise.
2022-05-13 13:32:23 +01:00
Jonathan Wakely
a278402216 libstdc++: Improve doxygen docs for some of <memory>
libstdc++-v3/ChangeLog:

	* doc/doxygen/user.cfg.in (PREDEFINED): Define
	_GLIBCXX23_CONSTEXPR macro.
	* include/backward/auto_ptr.h (auto_ptr): Use @deprecated.
	* include/bits/unique_ptr.h (default_delete): Use @since and
	@headerfile.
	* include/std/scoped_allocator: Remove @ingroup from @file
	block.
2022-05-13 13:32:23 +01:00
Jonathan Wakely
c29c2a0604 libstdc++: Improve doxygen docs for <thread> and <future>
libstdc++-v3/ChangeLog:

	* include/bits/std_thread.h (thread, thread::id): Improve
	doxygen docs.
	* include/std/future: Likewise.
	* include/std/thread (jthread): Likewise.
2022-05-13 13:32:23 +01:00
Jonathan Wakely
e61492549b libstdc++: Improve doxygen docs for algorithms and more
libstdc++-v3/ChangeLog:

	* include/bits/ostream_insert.h: Mark helper functions as
	undocumented by Doxygen.
	* include/bits/stl_algo.h: Use markdown for formatting and mark
	helper functions as undocumented.
	* include/bits/stl_numeric.h:  Likewise.
	* include/bits/stl_pair.h (pair): Add @headerfile.
2022-05-13 13:32:22 +01:00
Jonathan Wakely
171f41f124 libstdc++: Improve doxygen docs for std::allocator
libstdc++-v3/ChangeLog:

	* doc/doxygen/user.cfg.in (PREDEFINED): Define __allocator_base
	so that Doxygen shows the right base-class for std::allocator.
	* include/bits/alloc_traits.h: Improve doxygen docs.
	* include/bits/allocator.h: Likewise.
	* include/bits/new_allocator.h: Likewise.
	* include/ext/new_allocator.h: Likewise.
2022-05-13 13:32:22 +01:00
Jonathan Wakely
1b01963a4e libstdc++: Improve doxygen docs for <regex>
Add @headerfile and @since tags. Improve grouping of non-member
functions via @relates tags.

Mark the std::pair base class of std::sub_match as undocumented, so that
the docs don't show all the related non-member functions are part of the
sub_match API. Use a new macro to re-add the data members for Doxygen
only.

libstdc++-v3/ChangeLog:

	* doc/doxygen/user.cfg.in (PREDEFINED): Define macro
	_GLIBCXX_DOXYGEN_ONLY to expand its argument.
	* include/bits/c++config (_GLIBCXX_DOXYGEN_ONLY): Define.
	* include/bits/regex.h: Improve doxygen docs.
	* include/bits/regex_constants.h: Likewise.
	* include/bits/regex_error.h: Likewise.
2022-05-13 13:32:22 +01:00
Jonathan Wakely
1566ca0969 libstdc++: Improve doxygen docs for <atomic>
libstdc++-v3/ChangeLog:

	* include/std/atomic: Suppress doxygen docs for
	implementation details.
	* include/bits/atomic_base.h: Likewise.
	* include/bits/shared_ptr_atomic.h: Use markdown. Fix grouping
	so that std::atomic is not added to the pointer abstractions
	group.
2022-05-13 13:32:22 +01:00
Jonathan Wakely
20b917e7c0 libstdc++: Improve doxygen docs for <system_error>
libstdc++-v3/ChangeLog:

	* include/std/system_error: Improve doxygen comments.
2022-05-13 13:32:22 +01:00
Jonathan Wakely
757146fb1c libstdc++: Improve doxygen docs for std::pointer_traits
libstdc++-v3/ChangeLog:

	* include/bits/ptr_traits.h: Add some doxygen comments.
2022-05-13 13:32:22 +01:00
Jonathan Wakely
e4905f1185 libstdc++: Add macros for the inline namespace std::_V2
Use macros to open and close the inline namespace _V2 that is used for
ABI versioning of individual components such as chrono::system_clock.

This allows the namespace to be hidden in the docs generated by Doxygen,
so that we document std::foo instead of std::_V2::foo.

This also makes it easy to remove that namespace entirely for the
gnu-versioned-namespace build, where everything is already versioned as
std::__8 and there are no backwards compatibility guarantees.

libstdc++-v3/ChangeLog:

	* doc/doxygen/user.cfg.in (PREDEFINED): Expand new macros to
	nothing.
	* include/bits/c++config (_GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE)
	(_GLIBCXX_END_INLINE_ABI_NAMESPACE): Define new macros.
	* include/bits/algorithmfwd.h (_V2::__rotate): Use new macros
	for the namespace.
	* include/bits/chrono.h (chrono::_V2::system_clock): Likewise.
	* include/bits/stl_algo.h (_V2::__rotate): Likewise.
	* include/std/condition_variable (_V2::condition_variable_any):
	Likewise.
	* include/std/system_error (_V2::error_category): Likewise.
2022-05-13 13:32:22 +01:00
Jonathan Wakely
4163b0be81 libstdc++: Fix typo in doxygen @headerfile command
libstdc++-v3/ChangeLog:

	* include/bits/mofunc_impl.h: Fix doxygen command.
2022-05-13 13:32:21 +01:00
Jonathan Wakely
9c3a8fe34a libstdc++: Disable Doxygen GROUP_NESTED_COMPOUNDS config option
Before Doxygen version 1.9.2 this option is broken (see
https://github.com/doxygen/doxygen/issues/8638 for more details) and
classes are not added to the correct groups by @ingroup and @addtogroup.

Also remove the obsolete CLASS_DIAGRAMS option that causes a warning.

libstdc++-v3/ChangeLog:

	* doc/doxygen/user.cfg.in (GROUP_NESTED_COMPOUNDS): Set to NO.
	(CLASS_DIAGRAMS): Remove obsolete option.
2022-05-13 13:32:21 +01:00
GCC Administrator
49ace834ab Daily bump. 2022-05-13 00:16:30 +00:00
Jonathan Wakely
a0080f0285 libstdc++: Remove whitespace before preprocessor directives
These are harmless, but also unnecessary and inconsistent (and their
removal was requested by PR libstdc++/17632).

libstdc++-v3/ChangeLog:

	* config/locale/dragonfly/numeric_members.cc: Remove whitespace.
	* config/locale/gnu/numeric_members.cc: Likewise.
	* include/bits/locale_facets_nonio.h: Likewise.
	* libsupc++/typeinfo: Likewise.
2022-05-12 18:04:01 +01:00
GCC Administrator
e877898911 Daily bump. 2022-05-11 00:16:40 +00:00
Jonathan Wakely
ca97c87758 libstdc++: Add <spanstream> declarations to <iosfwd> [PR105284]
libstdc++-v3/ChangeLog:

	PR libstdc++/105284
	* include/std/iosfwd: Add declarations for <spanstream> class
	templates and typedefs.
	* include/std/spanstream (basic_spanbuf, basic_ispanstream)
	(basic_ospanstream, basic_spanstream): Remove default template
	arguments.
	* testsuite/27_io/headers/iosfwd/synopsis.cc: Add <spanstream>
	declarations.
	* testsuite/27_io/headers/iosfwd/types.cc: Check <spanstream>
	default arguments.
2022-05-10 16:40:22 +01:00
Jonathan Wakely
1807e07825 libstdc++: Add <syncstream> declarations to <iosfwd> [PR105284]
libstdc++-v3/ChangeLog:

	PR libstdc++/105284
	* include/std/iosfwd: Add declarations for <synstream> class
	templates and typedefs.
	* include/std/syncstream (basic_syncbuf, basic_osyncstream):
	Remove default template arguments.
	* testsuite/27_io/headers/iosfwd/synopsis.cc: New test.
	* testsuite/27_io/headers/iosfwd/types.cc: New test.
2022-05-10 16:40:22 +01:00
GCC Administrator
ea3fbfda60 Daily bump. 2022-05-07 00:16:26 +00:00
Jonathan Wakely
42991a9116 libstdc++: Simplify std::normal_distribution equality operator
libstdc++-v3/ChangeLog:

	* include/bits/random.tcc (operator==): Only check
	normal_distribution::_M_saved_available once.
	* testsuite/26_numerics/random/normal_distribution/operators/equal.cc:
	Check equality after state changes.
	* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error
	lineno.
2022-05-06 23:54:09 +01:00
Jonathan Wakely
909ef4e272 libstdc++: Fix deserialization for std::normal_distribution [PR105502]
This fixes a regression in std::normal_distribution deserialization that
caused the object to be left unchanged if the __state_avail value read
from the stream was false.

libstdc++-v3/ChangeLog:

	PR libstdc++/105502
	* include/bits/random.tcc
	(operator>>(basic_istream<C,T>&, normal_distribution<R>&)):
	Update state when __state_avail is false.
	* testsuite/26_numerics/random/normal_distribution/operators/serialize.cc:
	Check that deserialized object equals serialized one.
2022-05-06 23:54:09 +01:00
Alexandre Oliva
469c76f0d9 libstdc++: ppc: conditionalize vsx-only simd intrinsics
libstdc++'s bits/simd.h section for PowerPC, guarded by __ALTIVEC__,
defines various intrinsic vector types that are only available with
__VSX__: 64-bit long double, double, (un)signed long long, and 64-bit
(un)signed long.

experimental/simd/standard_abi_usable{,_2}.cc tests error out
reporting the unmet requirements when the target cpu doesn't enable
VSX.  Make the reported instrinsic types conditional on __VSX__ so
that <experimental/simd> can be used on PowerPC variants that do not
support VSX.


for  libstdc++-v3/ChangeLog

	* include/experimental/bits/simd.h [__ALTIVEC__]: Require VSX
	for double, long long, and 64-bit long intrinsic types.
	[__ALTIVEC__] (__intrinsic_type): Mention 128-bit in
	preexisting long double diagnostic, adjust no-VSX double
	diagnostic to cover 64-bit long double as well.
2022-05-06 15:43:42 -03:00
Jonathan Wakely
aa8bdfee1d libstdc++: Fix test that fails on Solaris [PR104731]
On Solaris the dirent::d_name member is a single char, causing this test
to fail with warnings about buffer overflow. Change the test to use a
union with additional space for writing a string to the d_name member.

libstdc++-v3/ChangeLog:

	PR libstdc++/104731
	* testsuite/27_io/filesystem/iterators/error_reporting.cc:
	Use a trailing char array as storage for dirent::d_name.
2022-05-06 14:51:35 +01:00
Jonathan Wakely
e112e37f29 libstdc++: Do not include <cxxabi.h> in <stacktrace>
This avoids polluting the global namespace with the "abi" namespace
alias.

libstdc++-v3/ChangeLog:

	* include/std/stacktrace: Do not include <cxxabi.h>.
	(__cxa_demangle): Declare.
2022-05-06 14:43:39 +01:00
Jonathan Wakely
488d268728 libstdc++: Do not use #include inside push visibility scope [PR99871]
libstdc++-v3/ChangeLog:

	PR libstdc++/99871
	* include/bits/specfun.h: Use visibility attribute on namespace,
	instead of pragma push/pop.
	* libsupc++/compare: Likewise.
	* libsupc++/exception: Likewise.
	* libsupc++/exception.h: Likewise.
	* libsupc++/exception_ptr.h: Likewise.
	* libsupc++/initializer_list: Likewise.
	* libsupc++/nested_exception.h: Likewise.
2022-05-06 14:43:39 +01:00
Jonathan Wakely
e03a0a4d73 libstdc++: Update documentation about copyright and GPL notices in tests
There is no need to require FSF copyright for tests that are just
"self-evident" ways to check the API and behaviour of the library.
This is consistent with tests for the compiler, which do not have
copyright and licence notices either.

libstdc++-v3/ChangeLog:

	* doc/xml/manual/test.xml: Remove requirement for copyright and
	GPL notice in tests.
	* doc/html/manual/test.html: Regenerate.
2022-05-06 14:43:38 +01:00
GCC Administrator
ab869e7f75 Daily bump. 2022-05-06 00:16:26 +00:00
Jonathan Wakely
b6b6600678 libstdc++: Fixes for tests that fail with -fno-rtti
This disables a use of dynamic_cast that is not valid for -fno-rtti and
adjusts some tests so they don't FAIL with -fno-rtti. Some tests are
skipped completely, and others just make use of typeid conditional on
the __cpp_rtti macro. A couple of tests were using typeid to verify
typedefs denote the right type, which can be done at compile-time using
templates instead.

libstdc++-v3/ChangeLog:

	* include/experimental/memory_resource [!__cpp_rtti]
	(__resource_adaptor_imp::do_is_equal): Do not use dynamic_cast
	when RTTI is disabled.
	* testsuite/17_intro/freestanding.cc: Require RTTI.
	* testsuite/18_support/exception/38732.cc: Likewise.
	* testsuite/18_support/exception_ptr/rethrow_exception.cc:
	Likewise.
	* testsuite/18_support/nested_exception/68139.cc: Likewise.
	* testsuite/18_support/nested_exception/rethrow_if_nested.cc:
	Likewise.
	* testsuite/18_support/type_info/103240.cc: Likewise.
	* testsuite/18_support/type_info/fundamental.cc: Likewise.
	* testsuite/18_support/type_info/hash_code.cc: Likewise.
	* testsuite/20_util/any/assign/emplace.cc: Likewise.
	* testsuite/20_util/any/cons/in_place.cc: Likewise.
	* testsuite/20_util/any/misc/any_cast.cc: Likewise.
	* testsuite/20_util/any/observers/type.cc: Likewise.
	* testsuite/20_util/function/1.cc: Likewise.
	* testsuite/20_util/function/2.cc: Likewise.
	* testsuite/20_util/function/3.cc: Likewise.
	* testsuite/20_util/function/4.cc: Likewise.
	* testsuite/20_util/function/5.cc: Likewise.
	* testsuite/20_util/function/6.cc: Likewise.
	* testsuite/20_util/function/7.cc: Likewise.
	* testsuite/20_util/function/8.cc: Likewise.
	* testsuite/20_util/polymorphic_allocator/resource.cc: Likewise.
	* testsuite/20_util/shared_ptr/casts/1.cc: Likewise.
	* testsuite/20_util/shared_ptr/casts/rval.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/unique_ptr_deleter_ref_2.cc:
	Likewise.
	* testsuite/20_util/shared_ptr/misc/get_deleter.cc: Likewise.
	* testsuite/20_util/typeindex/comparison_operators.cc: Likewise.
	* testsuite/20_util/typeindex/comparison_operators_c++20.cc:
	Likewise.
	* testsuite/20_util/typeindex/hash.cc: Likewise.
	* testsuite/20_util/typeindex/hash_code.cc: Likewise.
	* testsuite/20_util/typeindex/name.cc: Likewise.
	* testsuite/22_locale/ctype/is/string/89728_neg.cc: Likewise.
	* testsuite/22_locale/global_templates/standard_facet_hierarchies.cc:
	Likewise.
	* testsuite/22_locale/global_templates/user_facet_hierarchies.cc:
	Likewise.
	* testsuite/22_locale/locale/13630.cc: Check type without using
	RTTI.
	* testsuite/23_containers/array/requirements/non_default_constructible.cc:
	Require RTTI.
	* testsuite/27_io/basic_ostream/emit/1.cc: Likewise.
	* testsuite/27_io/fpos/14320-1.cc: Check type without using RTTI.
	* testsuite/27_io/fpos/mbstate_t/12065.cc: Require RTTI.
	* testsuite/27_io/ios_base/failure/dual_abi.cc: Likewise.
	* testsuite/experimental/any/misc/any_cast.cc: Likewise.
	* testsuite/experimental/any/observers/type.cc: Likewise.
	* testsuite/experimental/memory_resource/resource_adaptor.cc:
	Likewise.
	* testsuite/lib/libstdc++.exp (check_effective_target_rtti):
	Define new proc.
	* testsuite/tr1/3_function_objects/function/1.cc: Likewise.
	* testsuite/tr1/3_function_objects/function/2.cc: Likewise.
	* testsuite/tr1/3_function_objects/function/3.cc: Likewise.
	* testsuite/tr1/3_function_objects/function/4.cc: Likewise.
	* testsuite/tr1/3_function_objects/function/5.cc: Likewise.
	* testsuite/tr1/3_function_objects/function/6.cc: Likewise.
	* testsuite/tr1/3_function_objects/function/7.cc: Likewise.
	* testsuite/tr1/3_function_objects/function/8.cc: Likewise.
	* testsuite/tr2/bases/value.cc: Likewise.
	* testsuite/tr2/direct_bases/value.cc: Likewise.
	* testsuite/util/exception/safety.h [!__cpp_rtti]: Don't print
	types without RTTI.
2022-05-05 21:13:58 +01:00
GCC Administrator
3e7db51747 Daily bump. 2022-05-05 00:16:29 +00:00
Jonathan Wakely
22399ad6ed libstdc++: Add always_inline to the simplest std::array accessors [PR104719]
libstdc++-v3/ChangeLog:

	PR libstdc++/104719
	* include/std/array (array::size(), array::max_size())
	(array::empty(), array::data()): Add  always_inline attribute.
2022-05-04 16:24:56 +01:00
Jonathan Wakely
ef8d5ac08b libstdc++: Simplify std::array accessors [PR104719]
This removes the __array_traits::_S_ref and __array_traits::_S_ptr
accessors, which only exist to make the special case of std::array<T, 0>
syntactically well-formed.

By changing the empty type used as the std::array<T, 0>::_M_elems data
member to support operator[] and conversion to a pointer, we can write
code using the natural syntax. The indirection through _S_ref and
_S_ptr is removed for the common case, and a function call is only used
for the special case of zero-size arrays.

The invalid member access for zero-sized arrays is changed to use
__builtin_trap() instead of a null dereference. This guarantees a
runtime error if it ever gets called, instead of undefined behaviour
that is likely to get optimized out as unreachable.

libstdc++-v3/ChangeLog:

	PR libstdc++/104719
	* include/std/array (__array_traits::_S_ref): Remove.
	(__array_traits::_S_ptr): Remove.
	(__array_traits<T, 0>::_Type): Define operator[] and operator T*
	to provide an array-like API.
	(array::_AT_Type): Remove public typeef.
	(array::operator[], array::at, array::front, array::back): Use
	index operator to access _M_elems instead of _S_ref.
	(array::data): Use implicit conversion from _M_elems to pointer.
	(swap(array&, array&)): Use __enable_if_t helper.
	(get<I>): Use index operator to access _M_elems.
	* testsuite/23_containers/array/tuple_interface/get_neg.cc:
	Adjust dg-error line numbers.
2022-05-04 16:24:56 +01:00
GCC Administrator
e66af28d99 Daily bump. 2022-05-04 00:16:24 +00:00
Alexandre Oliva
25389f3de4 [PR105324] libstdc++: testsuite: pr105324 requires FP from_char
The floating-point overloads of from_char are only declared if
_GLIBCXX_HAVE_USELOCALE is #defined as nonzero.  That's exposed from
charconv as __cpp_lib_to_chars >= 201611L, so guard the test body with
that.


for  libstdc++-v3/ChangeLog

	PR c++/105324
	* testsuite/20_util/from_chars/pr105324.cc: Guard test body
	with conditional for floating-point overloads of from_char.
2022-05-03 14:57:15 -03:00
GCC Administrator
6259d8aa73 Daily bump. 2022-05-03 00:16:25 +00:00
Patrick Palka
86d821ddf5 libstdc++: Don't use std::tolower in <charconv> [PR103911]
As with std::isdigit in r12-6281-gc83ecfbe74a5cf, we shouldn't be using
std::tolower in <charconv> either.

	PR libstdc++/103911

libstdc++-v3/ChangeLog:

	* src/c++17/floating_from_chars.cc (find_end_of_float): Accept
	two delimeters for the exponent part in the form of a possibly
	NULL string of length two.  Don't use std::tolower.
	(pattern): Adjust calls to find_end_of_float accordingly.
2022-05-02 07:01:33 -04:00