Commit Graph

9142 Commits

Author SHA1 Message Date
Jonathan Wakely 541a9b104b libstdc++/71073 add system_header pragma to Debug Mode headers
PR libstdc++/71073
	* include/debug/bitset: Add #pragma GCC system_header.
	* include/debug/deque: Likewise.
	* include/debug/list: Likewise.
	* include/debug/map: Likewise.
	* include/debug/set: Likewise.
	* include/debug/string: Likewise.
	* include/debug/unordered_map: Likewise.
	* include/debug/unordered_set: Likewise.
	* include/debug/vector: Likewise.
	* include/debug/functions.h: Adjust whitespace.

From-SVN: r236211
2016-05-13 15:47:46 +01:00
Jonathan Wakely 068b220e52 Add dg-require-atomic-builtins to test
PR libstdc++/71081
	* testsuite/experimental/memory_resource/1.cc: Require atomics.

From-SVN: r236177
2016-05-12 15:08:45 +01:00
Jonathan Wakely 3d73ae6ea9 libstdc++/71049 fix --disable-libstdcxx-dual-abi bootstrap
PR libstdc++/71049
	* src/c++11/cow-stdexcept.cc [!_GLIBCXX_USE_DUAL_ABI]: Don't define
	exception constructors with __sso_string parameters.

From-SVN: r236118
2016-05-11 13:39:28 +01:00
Jonathan Wakely 7f99d40a99 Test begin and end functions for directory iterators
* include/experimental/bits/fs_dir.h (begin, end): Add noexcept.
	* testsuite/experimental/filesystem/iterators/directory_iterator.cc:
	Test begin and end functions.
	* testsuite/experimental/filesystem/iterators/
	recursive_directory_iterator.cc: Likewise.

From-SVN: r236085
2016-05-10 16:39:20 +01:00
Jonathan Wakely 6fe673ad0f libstdc++/71038 fix error checks in filesystem::copy_file
PR libstdc++/71038
	* src/filesystem/ops.cc (do_copy_file): Fix backwards conditions.
	* testsuite/experimental/filesystem/operations/copy_file.cc: New test.

From-SVN: r236084
2016-05-10 16:39:14 +01:00
Jonathan Wakely 77a87b2a0e Optimize __directory_iterator_proxy for the common case
* include/experimental/bits/fs_dir.h (__directory_iterator_proxy):
	Overload operator* to move from rvalues.

From-SVN: r236078
2016-05-10 14:09:22 +01:00
Jonathan Wakely f9a39467b6 libstdc++/71036 Handle EEXIST in filesystem::create_directory
PR libstdc++/71036
	* src/filesystem/ops.cc (create_dir): Handle EEXIST from mkdir.
	* testsuite/experimental/filesystem/operations/create_directory.cc:
	New test.

From-SVN: r236076
2016-05-10 14:04:21 +01:00
Jonathan Wakely 6f0800d418 libstdc++/71037 Add base path to filesystem::canonical exceptions
PR libstdc++/71037
	* src/filesystem/ops.cc (canonical(const path&, const path&)): Add
	base path to exception.
	* testsuite/experimental/filesystem/operations/canonical.cc: Test
	paths contained in exception.

From-SVN: r236074
2016-05-10 13:22:32 +01:00
Jonathan Wakely f10b2e1cae 2.cc: Remove unused using declaration.
* testsuite/experimental/type_erased_allocator/2.cc: Remove unused
	using declaration.

From-SVN: r236073
2016-05-10 13:04:22 +01:00
Jonathan Wakely d7187f9ea1 libstdc++/71005 fix post-increment for filesystem iterators
PR libstdc++/71005
	* include/experimental/bits/fs_dir.h (__directory_iterator_proxy):
	New type.
	(directory_iterator::operator++(int)): Return proxy.
	(recursive_directory_iterator::operator++(int)): Likewise.
	* testsuite/experimental/filesystem/iterators/directory_iterator.cc:
	Test post-increment.
	* testsuite/experimental/filesystem/iterators/
	recursive_directory_iterator.cc: Likewise.

From-SVN: r236072
2016-05-10 12:25:06 +01:00
Jonathan Wakely 7972e24663 libstdc++/71004 fix recent additions to testcase
PR libstdc++/71004
	* testsuite/experimental/filesystem/iterators/
	recursive_directory_iterator.cc: Fix test02 to not call member
	functions on invalid iterator, and use VERIFY not assert.

From-SVN: r236028
2016-05-09 12:50:01 +01:00
Ville Voutilainen fb334765e2 Avoid endless run-time recursion for copying single-element tuples where the...
Avoid endless run-time recursion for copying single-element
	tuples where the element type is by-value constructible
	from any type.
 	* include/std/tuple (_NotSameTuple): New.
 	* include/std/tuple (tuple(_UElements&&...): Use it.
	* testsuite/20_util/tuple/cons/element_accepts_anything_byval.cc: New.

From-SVN: r236025
2016-05-09 14:03:36 +03:00
Jonathan Wakely e4cce0cea0 libstdc++/71004 fix recursive_directory_iterator default constructor
PR libstdc++/71004
	* include/experimental/bits/fs_dir.h (recursive_directory_iterator):
	Initialize scalar member variables in default constructor.
	* testsuite/experimental/filesystem/iterators/
	recursive_directory_iterator.cc: Teste default construction.

From-SVN: r236023
2016-05-09 11:09:37 +01:00
Rainer Orth 40436d8169 Enable dg-reqire-sharedlib on Solaris
* testsuite/lib/libstdc++.exp (libstdc++_init): Enable on *-*-solaris*.

From-SVN: r235931
2016-05-05 19:54:42 +00:00
Jonathan Wakely f5c40ce2cf Add dg-require-filesystem-ts directive to test
* testsuite/experimental/filesystem/path/native/string.cc: Add
	dg-require-filesystem-ts directive.

From-SVN: r235919
2016-05-05 11:03:56 +01:00
Jonathan Wakely d9cb3e7598 libstdc++/70940 Start fixing polymorphic memory resources
PR libstdc++/70940
	* include/experimental/memory_resource
	(__resource_adaptor_imp::do_allocate): Do not default-construct
	rebound allocator.
	(__resource_adaptor_imp::do_deallocate): Likewise. Use
	allocator_traits to get pointer type.
	(__null_memory_resource::do_allocate): Remove unused parameters.
	(__null_memory_resource::do_deallocate): Likewise.
	(__null_memory_resource::do_is_equal): Likewise. Add return statement.
	* testsuite/experimental/type_erased_allocator/1.cc: Combine with ...
	* testsuite/experimental/type_erased_allocator/1_neg.cc: This, and
	move to ...
	* testsuite/experimental/memory_resource/1.cc: Here.
	* testsuite/experimental/memory_resource/null_memory_resource.cc: New.
	* testsuite/experimental/memory_resource/resource_adaptor.cc: New.

From-SVN: r235868
2016-05-04 13:08:45 +01:00
Chris Gregory f92ab29ffa Remove trailing whitespace from libstdc++-v3 files
2016-04-29  Chris Gregory  <czipperz@gmail.com>

	* config/*: Remove trailing whitespace.
	* src/*: Likewise.
	* testsuite/tr1/*: Likewise.
	* testsuite/util/*: Likewise.

From-SVN: r235645
2016-04-29 17:11:43 +01:00
Jonathan Wakely 9f9eb84eac libstdc++/70766 use std::addressof instead of operator&
PR libstdc++/70766
	* include/bits/basic_ios.tcc (basic_ios::_M_cache_locale): Use
	__addressof.
	* include/bits/stream_iterator.h (istream_iterator, ostream_iterator):
	Likewise.
	* include/std/atomic (atomic<_Tp>): Likewise.
	* include/std/shared_mutex (shared_lock): Likewise.
	* testsuite/24_iterators/istream_iterator/70766.cc: New test.
	* testsuite/24_iterators/ostream_iterator/70766.cc : New test.
	* testsuite/29_atomics/atomic/60695.cc: Adjust dg-error line number.
	* testsuite/29_atomics/atomic/70766.cc: New test.
	* testsuite/30_threads/shared_lock/70766.cc: New test.

From-SVN: r235565
2016-04-28 13:33:07 +01:00
Jonathan Wakely 272b2ce49f hashtable_policy.h (__detail::_Insert_base, [...]): Improve comments.
* include/bits/hashtable_policy.h (__detail::_Insert_base,
	__detail::_Insert): Improve comments.

From-SVN: r235564
2016-04-28 13:32:50 +01:00
Jonathan Wakely 45e206963a libstdc++/70767 Define std::numeric_limits<cv T> in C++98 mode
PR libstdc++/70767
	* include/std/limits: Update comments about DRs.
	(numeric_limits<const _Tp>, numeric_limits<volatile _Tp>,
	numeric_limits<const volatile _Tp>): Define unconditionally.

From-SVN: r235486
2016-04-27 12:57:58 +01:00
Jonathan Wakely a635cdb2cc libstdc++/70762 fix fallback implementation of nonexistent_path
PR libstdc++/70762
	* testsuite/util/testsuite_fs.h (__gnu_test::nonexistent_path): Use
	static counter to return a different path on every call.

From-SVN: r235395
2016-04-24 19:06:54 +01:00
Tim Shen 216f7526fe re PR libstdc++/70745 (Wrong handling of regex_constant::match_not_eow and regex_constant::match_not_bow)
PR libstdc++/70745
	* include/bits/regex_executor.tcc (_Executor<>::_M_word_boundary):
	Fix the match_not_bow and match_not_eow behavior.
	* testsuite/28_regex/regression.cc: Add testcase.

From-SVN: r235382
2016-04-23 03:58:37 +00:00
Jonathan Wakely a1e1ec7605 Fix std::codecvt_utf8* for big-endian targets
PR libstdc++/69703
	* src/c++11/codecvt.cc (__codecvt_utf8_base<char16_t>::do_in,
	__codecvt_utf8_utf16_base<char16_t>::do_in): Fix mask operations.

From-SVN: r235293
2016-04-20 18:40:02 +01:00
Jonathan Wakely 29ca91f72e libstdc++/69703 ignore endianness in codecvt_utf8
PR libstdc++/69703
	* src/c++11/codecvt.cc (__codecvt_utf8_base<char16_t>::do_in)):
	Override endianness bit in mode.
	* testsuite/22_locale/codecvt/codecvt_utf8/69703.cc: New test.
	* testsuite/22_locale/codecvt/codecvt_utf8_utf16/66855.cc: Test
	that little_endian mode is ignored.
	* testsuite/experimental/filesystem/path/native/string.cc: New test.

From-SVN: r235216
2016-04-19 19:02:46 +01:00
Jonathan Wakely 1490525104 libstdc++/70609 fix filesystem::copy()
PR libstdc++/70609
	* src/filesystem/ops.cc (close_fd): New function.
	(do_copy_file): Set permissions before copying file contents. Check
	result of closing file descriptors. Don't copy streambuf when file
	is empty.
	(copy(const path&, const path&, copy_options, error_code&)): Use
	lstat for source file when copy_symlinks is set.
	* testsuite/experimental/filesystem/operations/copy.cc: Test copy().

From-SVN: r235215
2016-04-19 19:02:39 +01:00
Jonathan Wakely 9c476ad426 Add noexcept to Filesystem TS operators
* include/experimental/bits/fs_fwd.h (operator&, operator|, operator^,
	operator~ operator&=, operator|=, operator^=): Add noexcept to
	overloaded operators for copy_options, perms and directory_options.
	* src/filesystem/ops.cc (make_file_type, make_file_status,
	is_not_found_errno, file_time): Add noexcept.

From-SVN: r235214
2016-04-19 19:02:32 +01:00
Edward Smith-Rowland d855ad89cb c++14_warning.h: Do not refer C++14 as experimental.
2016-04-19  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* include/bits/c++14_warning.h: Do not refer C++14 as experimental.

From-SVN: r235210
2016-04-19 16:29:05 +00:00
Jonathan Wakely 0cded43df4 PR libstdc++/41759 reword static assertions in <random>
PR libstdc++/41759
	* include/bits/random.h: Reword static assertion messages to state
	positive conditions.
	* include/bits/random.tcc: Likewise.
	* include/bits/uniform_int_dist.h: Likewise.
	* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error
	patterns.

From-SVN: r235160
2016-04-18 19:03:50 +01:00
Jonathan Wakely 90751aa731 Remove unused typedefs in std::bind types
* include/std/function (_Bind, _Bind_result): Remove unused typedefs.

From-SVN: r235157
2016-04-18 17:37:56 +01:00
Jonathan Wakely 351a5f8142 * config/cpu/sh/atomicity.h: Fix typo in comment.
From-SVN: r235156
2016-04-18 17:19:25 +01:00
Jonathan Wakely b05cf382e0 Define std:🧵:id comparison operators at namespace-scope
From-SVN: r235155
2016-04-18 17:16:14 +01:00
Jonathan Wakely 4ed6e52446 Make use of extensions more explicit in libstdc++ tests
* testsuite/18_support/bad_exception/23591_thread-1.c: Add
	-Wno-pedantic to dg-options.
	* testsuite/20_util/align/2.cc: Use type as operand of alignof.
	* testsuite/20_util/is_floating_point/value.cc: Add -Wno-pedantic
	to dg-options.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill/32158.cc:
	Remove extra semi-colon.
	* testsuite/23_containers/array/tuple_interface/tuple_element.cc:
	Always supply second argument to static_assert.
	* testsuite/25_algorithms/lower_bound/no_operator_ne.cc: Remove extra
	semi-colon.
	* testsuite/26_numerics/complex/c99.cc: Add -Wno-pedantic to
	dg-options.
	* testsuite/26_numerics/complex/literals/values.cc: Likewise.
	* testsuite/29_atomics/atomic/60695.cc: Likewise.
	* testsuite/29_atomics/atomic/62259.cc: use __alignof__ instead of
	alignof when operand is an object not a type.
	* testsuite/decimal/ctor.cc: Add -Wno-pedantic to dg-options.
	* testsuite/decimal/make-decimal.cc: Likewise.
	* testsuite/experimental/type_traits/value.cc: Always supply second
	argument to static_assert.
	* testsuite/util/testsuite_common_types.h: Use __extension__ for
	__int128 types.

From-SVN: r235154
2016-04-18 16:44:25 +01:00
Jonathan Wakely abb6e0a19d Don't include internal header in libstdc++ tests
* testsuite/experimental/type_erased_allocator/1.cc: Don't include
	internal header.
	* testsuite/experimental/type_erased_allocator/1_neg.cc: Likewise.
	* testsuite/experimental/type_erased_allocator/2.cc: Likewise.
	* testsuite/experimental/type_erased_allocator/uses_allocator.cc:
	Likewise. Add licence and change to compile-only test.

From-SVN: r235153
2016-04-18 16:44:16 +01:00
Jonathan Wakely 6b6147dd48 Add attribute((unused)) in libstdc++ headers
* include/bits/locale_facets.h (ctype::do_narrow): Add attribute to
	unused parameter.
	* include/bits/regex_automaton.h (_NFA::_M_insert_alt): Likewise.

From-SVN: r235152
2016-04-18 16:44:12 +01:00
Jonathan Wakely 8dc1e574ae Avoid -Wsign-compare warnings in std::to_string()
* include/ext/string_conversions.h (__stoa): Avoid -Wsign-compare
        warnings.

From-SVN: r235151
2016-04-18 16:43:50 +01:00
Edward Smith-Rowland 80dbaf98d4 Trivial comment misspelling.
From-SVN: r235092
2016-04-18 02:32:50 +00:00
Edward Smith-Rowland 9a9534e162 Obvious typo in comment.
From-SVN: r235091
2016-04-18 02:30:31 +00:00
Jason Merrill 9f285ccb77 Revert empty class parameter passing ABI changes.
From-SVN: r234977
2016-04-14 12:23:06 -04:00
Martin Sebor 342fac9537 PR c++/69517 - [5/6 regression] SEGV on a VLA with excess initializer elements
PR c++/69517 - [5/6 regression] SEGV on a VLA with excess initializer elements
PR c++/70019 - VLA size overflow not detected
PR c++/70588 - SIGBUS on a VLA larger than SIZE_MAX / 2

gcc/testsuite/ChangeLog:
2016-04-13  Martin Sebor  <msebor@redhat.com>

        PR c++/69517
        PR c++/70019
        PR c++/70588
        * c-c++-common/ubsan/vla-1.c (main): Catch exceptions.
        * g++.dg/cpp1y/vla11.C: New test.
        * g++.dg/cpp1y/vla12.C: New test.
        * g++.dg/cpp1y/vla13.C: New test.
        * g++.dg/cpp1y/vla14.C: New test.
        * g++.dg/cpp1y/vla3.C: Restore deleted test.
        * gcc/testsuite/g++.dg/init/array24.C: Fully brace VLA initializer.
        * g++.dg/ubsan/vla-1.C: Disable exceptions.

gcc/cp/ChangeLog:
2016-04-13  Martin Sebor  <msebor@redhat.com>

        PR c++/69517
        PR c++/70019
        PR c++/70588
        * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
        functions.
        * decl.c (check_initializer, cp_finish_decl): Call them.
        (reshape_init_r): Reject incompletely braced intializer-lists
        for VLAs.
        * init.c (throw_bad_array_length, build_vla_check)
        (build_vla_size_check, build_vla_init_check): Define new functions.
        * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
        to detect a VLA.
        (store_init_value): Same.

gcc/doc/ChangeLog:
2016-04-13  Martin Sebor  <msebor@redhat.com>

        PR c++/69517
        PR c++/70019
        PR c++/70588
        * extend.texi (Variable Length): Document C++ specifics.

libstdc++-v3/ChangeLog:
2016-04-13  Martin Sebor  <msebor@redhat.com>

        PR c++/69517
        * testsuite/25_algorithms/rotate/moveable2.cc: Make sure VLA
       upper bound is positive.

From-SVN: r234966
2016-04-13 17:26:41 -06:00
Jonathan Wakely a6297ab587 Adjust for new empty class parameter passing ABI.
* include/bits/c++config (_GLIBCXX_BEGIN_NAMESPACE_EMPTY_TYPES,
	_GLIBCXX_END_NAMESPACE_EMPTY_TYPES, _GLIBCXX_ABI_TAG_EMPTY): Define.
	* include/bits/hashtable.h (_Hashtable::_M_emplace): Change signatures
	of functions taking empty structs by value. Add a template parameter
	to overloads without hints. Rename overloads with hints to
	_M_emplace_hint.
	(_Hashtable::_M_erase(true_type, const_iterator),
	_Hashtable::_M_erase(false_type, const_iterator)): Change signatures
	by reordering parameters.
	* include/bits/hashtable_policy.h (_Insert::insert): Adjust to call
	_M_emplace_hint instead of _M_emplace.
	* include/bits/shared_ptr.h (shared_ptr(_Tp1*, _Deleter, _Alloc),
	shared_ptr(nullptr_t, _Deleter, _Alloc)): Use _GLIBCXX_ABI_TAG_EMPTY.
	* include/bits/shared_ptr_base.h (_Sp_counted_deleter, __shared_count,
	__shared_ptr): Likewise.
	* include/bits/stl_algo.h (replace_if): Likewise.
	* include/bits/stl_pair.h (piecewise_construct_t,
	piecewise_construct): Use _GLIBCXX_BEGIN_NAMESPACE_EMPTY_TYPES.
	* include/bits/uses_allocator.h (allocator_arg_t, allocator_arg,
	__uses_alloc0): Likewise.
	* include/ext/pb_ds/assoc_container.hpp (basic_hash_table): Likewise.
	* testsuite/20_util/scoped_allocator/69293_neg.cc: Adjust dg-error.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/void_neg.cc: Likewise.
	* testsuite/20_util/uses_allocator/69293_neg.cc: Likewise.
	* testsuite/20_util/uses_allocator/cons_neg.cc: Likewise.
	* testsuite/ext/profile/mutex_extensions_neg.cc: Likewise.

From-SVN: r234964
2016-04-13 23:00:50 +01:00
Edward Smith-Rowland 0c39f36dc5 Document C++17/TR29124 C++ Special Math Functions.
2016-04-12  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Document C++17/TR29124 C++ Special Math Functions.
	* include/bits/specfun.h: Add Doxygen markup.

From-SVN: r234905
2016-04-12 16:31:25 +00:00
Jonathan Wakely 6da8b93163 * testsuite/30_threads/thread/70503.cc: Adjust from xfail to pass.
From-SVN: r234808
2016-04-07 15:26:24 +01:00
Eric Botcazou 49a52ebcc0 Makefile.am (libstdc++-symbols.ver): Remove useless /dev/null.
* src/Makefile.am (libstdc++-symbols.ver): Remove useless /dev/null.
	* src/Makefile.in: Regenerate.

From-SVN: r234782
2016-04-06 15:07:49 +00:00
Jonathan Wakely d2aee115cc Restore atomic builtins usage in libstdc++-v3
PR libstdc++/70554
	* acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Don't test
	__atomic_fetch_add for bool.
	* configure: Regenerate.

From-SVN: r234761
2016-04-05 20:03:46 +01:00
Jonathan Wakely d5ec69f374 * testsuite/30_threads/thread/70503.cc: Require -static to work.
From-SVN: r234757
2016-04-05 18:21:48 +01:00
Jonathan Wakely 87cec93ee0 Ensure std::thread helpers have internal linkage
PR libstdc++/70503
	* src/c++11/thread.cc (execute_native_thread_routine,
	execute_native_thread_routine_compat): Give internal linkage.
	* testsuite/30_threads/thread/70503.cc: New test.

From-SVN: r234746
2016-04-05 14:35:32 +01:00
Ville Voutilainen 7b3318c41e re PR libstdc++/70437 (Instantiation loop with pair and is_constructible)
PR libstdc++/70437
 	* include/bits/stl_pair.h (_ConstructiblePair,
	_ImplicitlyConvertiblePair, _MoveConstructiblePair,
	_ImplicitlyMoveConvertiblePair): Add shortcut conditions
	for same-type cases.
	* testsuite/20_util/pair/70437.cc: New.

From-SVN: r234743
2016-04-05 14:31:30 +03:00
Jonathan Wakely 00e6c25ac8 libstdc++/69945 Add __gnu_cxx::__freeres hook
PR libstdc++/69945
	* config/abi/pre/gnu.ver: Add new symbol.
	* libsupc++/eh_alloc.cc (__gnu_cxx::__freeres): Define.
	* testsuite/18_support/free_eh_pool.cc: New test.

From-SVN: r234465
2016-03-24 18:13:40 +00:00
Bernd Edlinger bfd84e6ba5 Makefile.am (install-freestanding-headers): Add concept_check.h and move.h to the installed headers.
2016-03-23  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * include/Makefile.am (install-freestanding-headers): Add
        concept_check.h and move.h to the installed headers.
        * include/Makefile.in: Regenerated.
        * include/bits/concept_check.h: Ignore _GLIBCXX_CONCEPT_CHECKS for
        freestanding implementations.
        * doc/xml/manual/using.xml (_GLIBCXX_CONCEPT_CHECKS): Mention
        that this macro has no effect for freestanding implementations.
        * doc/html/manual/using_macros.html: Likewise.

From-SVN: r234414
2016-03-23 00:41:52 +00:00
Uros Bizjak f2f48c6c60 * libsupc++/guard.cc: Revert my last commit.
From-SVN: r234336
2016-03-18 16:44:44 +01:00