Tim Shen
3203ed5f01
re PR libstdc++/78441 ([variant] variant_alternative doesn't allow cv qualifiers)
...
PR libstdc++/78441
* include/std/variant: Propagate cv qualifications to types returned
by variant_alternative.
* testsuite/20_util/variant/compile.cc: Tests.
From-SVN: r242892
2016-11-27 00:32:04 +00:00
Jonathan Wakely
756316926e
Fix PR number in ChangeLog
...
From-SVN: r242765
2016-11-23 15:32:37 +00:00
Felix Morgner
f6cdfe8264
PR78494 add missing returns to propagate_const
...
2016-11-23 Felix Morgner <felix.morgner@gmail.com>
Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/78494
* include/experimental/propagate_const (propagate_const::operator=):
Add missing return statements.
* testsuite/experimental/propagate_const/assignment/move_neg.cc:
Adjust dg-error line numbers.
* testsuite/experimental/propagate_const/requirements2.cc: Likewise.
Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>
From-SVN: r242760
2016-11-23 14:45:29 +00:00
Uros Bizjak
b2b0acbe2b
Makefile.in ($(lang_checks_parallelized)): Fix detection of -j argument.
...
gcc/ChangeLog
* Makefile.in ($(lang_checks_parallelized)): Fix detection
of -j argument.
gcc/ada/ChangeLog
* gcc-interface/Make-lang.in (check-acats): Fix detection
of -j argument.
libstdc++-v3/ChangeLog
* testsuite/Makefile.am
(check-DEJAGNU $(check_DEJAGNU_normal_targets)): Fix detection
of -j argument.
* testsuite/Makefile.in: Regenereate.
From-SVN: r242705
2016-11-22 17:33:43 +01:00
Jonathan Wakely
dba814afda
PR78465 Remove runtime tests for <atomic> macros
...
PR libstdc++/78465
* testsuite/29_atomics/headers/atomic/macros.cc: Replace runtime tests
with preprocessor conditions.
From-SVN: r242704
2016-11-22 16:31:19 +00:00
Rainer Orth
3115f94f7f
Don't define libstdc++-internal macros in Solaris 10+ <math.h>
...
libstdc++-v3:
* acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): Update comments.
(__CORRECT_ISO_CPP11_MATH_H_PROTO): Rename to ...
(__CORRECT_ISO_CPP11_MATH_H_PROTO_FP): ... this.
Add test for C++11 <math.h> integral overloads.
* configure: Regenerate.
* config.h.in: Regenerate.
* include/c_global/cmath [__cplusplus >= 201103L]: Reflect
__CORRECT_ISO_CPP11_MATH_H_PROTO to
__CORRECT_ISO_CPP11_MATH_H_PROTO_FP rename.
* include/c_global/cmath [_GLIBCXX_USE_C99_MATH &&
!_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC && __cplusplus >= 201103L]
(std::fpclassify): Wrap in !__CORRECT_ISO_CPP11_MATH_H_PROTO_INT.
(std::isfinite): Likewise.
(std::isinf): Likewise.
(std::isnan): Likewise.
(std::isnormal): Likewise.
(std::signbit): Likewise.
(std::isgreater): Likewise.
(std::isgreaterequal): Likewise.
(std::isless): Likewise.
(std::islessequal): Likewise.
(std::islessgreater): Likewise.
(std::isunordered): Likewise.
[__cplusplus >= 201103L && _GLIBCXX_USE_C99_MATH_TR1]
(std::acosh): Likewise.
(std::asinh): Likewise.
(std::atanh): Likewise.
(std::cbrt): Likewise.
(std::copysign): Likewise.
(std::erf): Likewise.
(std::erfc): Likewise.
(std::exp2): Likewise.
(std::expm1): Likewise.
(std::fdim): Likewise.
(std::fma): Likewise.
(std::fmax): Likewise.
(std::fmin): Likewise.
(std::hypot): Likewise.
(std::ilogb): Likewise.
(std::lgamma): Likewise.
(std::llrint): Likewise.
(std::llround): Likewise.
(std::log1p): Likewise.
(std::log2): Likewise.
(std::logb): Likewise.
(std::lrint): Likewise.
(std::lround): Likewise.
(std::nearbyint): Likewise.
(std::nextafter): Likewise.
(std::nexttoward): Likewise.
(std::remainder): Likewise.
(std::remquo): Likewise.
(std::rint): Likewise.
(std::round): Likewise.
(std::scalbln): Likewise.
(std::scalbn): Likewise.
(std::tgamma): Likewise.
(std::trunc): Likewise.
* include/tr1/cmath [_GLIBCXX_USE_C99_MATH_TR1 && __cplusplus >=
201103L]: Reflect __CORRECT_ISO_CPP11_MATH_H_PROTO to
__CORRECT_ISO_CPP11_MATH_H_PROTO_FP rename.
fixincludes:
* inclhack.def (solaris_math_12): New fix.
(hpux11_fabsf): Replace bypass by *-hp-hpux11* mach selector.
* fixincl.x: Regenerate.
* tests/base/math.h [SOLARIS_MATH_12_CHECK]: New test.
From-SVN: r242671
2016-11-21 16:09:47 +00:00
Jonathan Wakely
27b3b3f4e6
PR 59406 note that FNV hash functions are incorrect
...
PR libstdc++/59406
* include/bits/functional_hash.h: Add comment noting difference from
FNV-1a.
* include/tr1/functional_hash.h: Likewise.
* libsupc++/hash_bytes.cc: Likewise.
From-SVN: r242454
2016-11-15 20:17:39 +00:00
Jonathan Wakely
3663671a13
Use existing helper for new std::string constructor
...
* include/bits/basic_string.h: Reuse _If_sv alias template for new
constructor.
From-SVN: r242453
2016-11-15 19:32:52 +00:00
Jonathan Wakely
6ae2ae3b84
Make std::tuple_size<cv T> SFINAE-friendly (LWG 2770)
...
* doc/xml/manual/intro.xml: Document LWG 2770 status. Remove entries
for 2742 and 2748.
* doc/html/*: Regenerate.
* include/std/utility (__tuple_size_cv_impl): New helper to safely
detect tuple_size<T>::value, as per LWG 2770.
(tuple_size<cv T>): Adjust partial specializations to derive from
__tuple_size_cv_impl.
* testsuite/20_util/tuple/cv_tuple_size.cc: Test SFINAE-friendliness.
From-SVN: r242452
2016-11-15 19:32:44 +00:00
Jonathan Wakely
6f959acccb
Adjust pretty printer test for variant<T&>
...
* testsuite/libstdc++-prettyprinters/cxx17.cc: Adjust test for
variant<T&>.
From-SVN: r242449
2016-11-15 19:29:07 +00:00
Tim Shen
7b277e8b46
variant: Remove variant<T&>...
...
* include/std/variant: Remove variant<T&>, variant<void>, variant<> support
to rebase on the post-Issaquah design.
* testsuite/20_util/variant/compile.cc: Likewise.
From-SVN: r242437
2016-11-15 17:26:59 +00:00
Matthias Klose
84c1b9d3d4
config-ml.in: Remove references to GCJ.
...
<toplevel>
2016-11-15 Matthias Klose <doko@ubuntu.com>
* config-ml.in: Remove references to GCJ.
* configure.ac: Likewise.
* configure: Regenerate.
config/
2016-11-15 Matthias Klose <doko@ubuntu.com>
multi.m4: Don't set GCJ.
gcc/
2016-11-15 Matthias Klose <doko@ubuntu.com>
* doc/install.texi: Remove references to gcj/libjava.
* doc/invoke.texi: Likewise.
*/ (where necessary)
2016-11-15 Matthias Klose <doko@ubuntu.com>
* configure: Regenerate.
From-SVN: r242433
2016-11-15 16:34:02 +00:00
Jonathan Wakely
c7cbb4dafb
Fix find&replace error in license boilerplate
...
* testsuite/19_diagnostics/error_code/is_error_code_v.cc: Fix license
text.
* testsuite/20_util/any/assign/emplace.cc: Likewise.
* testsuite/20_util/any/cons/in_place.cc: Likewise.
* testsuite/20_util/any/make_any.cc: Likewise.
* testsuite/20_util/any/requirements.cc: Likewise.
* testsuite/20_util/any/typedefs.cc: Likewise.
* testsuite/20_util/bind/is_placeholder_v.cc: Likewise.
* testsuite/20_util/duration/requirements/treat_as_floating_point_v.cc:
Likewise.
* testsuite/20_util/in_place/requirements.cc: Likewise.
* testsuite/20_util/optional/77288.cc: Likewise.
* testsuite/20_util/optional/assignment/1.cc: Likewise.
* testsuite/20_util/optional/assignment/2.cc: Likewise.
* testsuite/20_util/optional/assignment/3.cc: Likewise.
* testsuite/20_util/optional/assignment/4.cc: Likewise.
* testsuite/20_util/optional/assignment/5.cc: Likewise.
* testsuite/20_util/optional/assignment/6.cc: Likewise.
* testsuite/20_util/optional/assignment/7.cc: Likewise.
* testsuite/20_util/optional/cons/77727.cc: Likewise.
* testsuite/20_util/optional/cons/move.cc: Likewise.
* testsuite/20_util/optional/cons/value.cc: Likewise.
* testsuite/20_util/optional/cons/value_neg.cc: Likewise.
* testsuite/20_util/optional/constexpr/cons/value.cc: Likewise.
* testsuite/20_util/optional/constexpr/make_optional.cc: Likewise.
* testsuite/20_util/optional/constexpr/observers/1.cc: Likewise.
* testsuite/20_util/optional/constexpr/observers/2.cc: Likewise.
* testsuite/20_util/optional/constexpr/observers/3.cc: Likewise.
* testsuite/20_util/optional/constexpr/observers/4.cc: Likewise.
* testsuite/20_util/optional/constexpr/observers/5.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/1.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/2.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/3.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/4.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/5.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/6.cc: Likewise.
* testsuite/20_util/optional/hash.cc: Likewise.
* testsuite/20_util/optional/make_optional.cc: Likewise.
* testsuite/20_util/optional/observers/1.cc: Likewise.
* testsuite/20_util/optional/observers/2.cc: Likewise.
* testsuite/20_util/optional/observers/3.cc: Likewise.
* testsuite/20_util/optional/observers/4.cc: Likewise.
* testsuite/20_util/optional/observers/5.cc: Likewise.
* testsuite/20_util/optional/observers/6.cc: Likewise.
* testsuite/20_util/optional/relops/1.cc: Likewise.
* testsuite/20_util/optional/relops/2.cc: Likewise.
* testsuite/20_util/optional/relops/3.cc: Likewise.
* testsuite/20_util/optional/relops/4.cc: Likewise.
* testsuite/20_util/optional/relops/5.cc: Likewise.
* testsuite/20_util/optional/relops/6.cc: Likewise.
* testsuite/20_util/optional/requirements.cc: Likewise.
* testsuite/20_util/optional/swap/1.cc: Likewise.
* testsuite/20_util/optional/typedefs.cc: Likewise.
* testsuite/20_util/ratio/requirements/ratio_equal_v.cc: Likewise.
* testsuite/20_util/tuple/tuple_size_v.cc: Likewise.
* testsuite/20_util/uses_allocator/requirements/uses_allocator_v.cc:
Likewise.
* testsuite/20_util/variable_templates_for_traits.cc: Likewise.
* testsuite/20_util/variant/hash.cc: Likewise.
* testsuite/21_strings/basic_string_view/typedefs.cc: Likewise.
* testsuite/experimental/any/typedefs.cc: Likewise.
* testsuite/experimental/array/make_array.cc: Likewise.
* testsuite/experimental/array/neg.cc: Likewise.
* testsuite/experimental/chrono/value.cc: Likewise.
* testsuite/experimental/deque/erasure.cc: Likewise.
* testsuite/experimental/forward_list/erasure.cc: Likewise.
* testsuite/experimental/list/erasure.cc: Likewise.
* testsuite/experimental/map/erasure.cc: Likewise.
* testsuite/experimental/memory/observer_ptr/assignment/assign.cc:
Likewise.
* testsuite/experimental/memory/observer_ptr/cons/cons.cc: Likewise.
* testsuite/experimental/memory/observer_ptr/hash/hash.cc: Likewise.
* testsuite/experimental/memory/observer_ptr/make_observer.cc:
Likewise.
* testsuite/experimental/memory/observer_ptr/relops/relops.cc:
Likewise.
* testsuite/experimental/memory/observer_ptr/requirements.cc: Likewise.
* testsuite/experimental/memory/observer_ptr/swap/swap.cc: Likewise.
* testsuite/experimental/memory/observer_ptr/typedefs.cc: Likewise.
* testsuite/experimental/optional/77288.cc: Likewise.
* testsuite/experimental/optional/assignment/1.cc: Likewise.
* testsuite/experimental/optional/assignment/2.cc: Likewise.
* testsuite/experimental/optional/assignment/3.cc: Likewise.
* testsuite/experimental/optional/assignment/4.cc: Likewise.
* testsuite/experimental/optional/assignment/5.cc: Likewise.
* testsuite/experimental/optional/assignment/6.cc: Likewise.
* testsuite/experimental/optional/cons/77727.cc: Likewise.
* testsuite/experimental/optional/cons/move.cc: Likewise.
* testsuite/experimental/optional/cons/value.cc: Likewise.
* testsuite/experimental/optional/cons/value_neg.cc: Likewise.
* testsuite/experimental/optional/constexpr/cons/value.cc: Likewise.
* testsuite/experimental/optional/constexpr/make_optional.cc: Likewise.
* testsuite/experimental/optional/constexpr/observers/1.cc: Likewise.
* testsuite/experimental/optional/constexpr/observers/2.cc: Likewise.
* testsuite/experimental/optional/constexpr/observers/3.cc: Likewise.
* testsuite/experimental/optional/constexpr/observers/4.cc: Likewise.
* testsuite/experimental/optional/constexpr/observers/5.cc: Likewise.
* testsuite/experimental/optional/constexpr/relops/1.cc: Likewise.
* testsuite/experimental/optional/constexpr/relops/2.cc: Likewise.
* testsuite/experimental/optional/constexpr/relops/3.cc: Likewise.
* testsuite/experimental/optional/constexpr/relops/4.cc: Likewise.
* testsuite/experimental/optional/constexpr/relops/5.cc: Likewise.
* testsuite/experimental/optional/constexpr/relops/6.cc: Likewise.
* testsuite/experimental/optional/make_optional.cc: Likewise.
* testsuite/experimental/optional/observers/1.cc: Likewise.
* testsuite/experimental/optional/observers/2.cc: Likewise.
* testsuite/experimental/optional/observers/3.cc: Likewise.
* testsuite/experimental/optional/observers/4.cc: Likewise.
* testsuite/experimental/optional/observers/5.cc: Likewise.
* testsuite/experimental/optional/relops/1.cc: Likewise.
* testsuite/experimental/optional/relops/2.cc: Likewise.
* testsuite/experimental/optional/relops/3.cc: Likewise.
* testsuite/experimental/optional/relops/4.cc: Likewise.
* testsuite/experimental/optional/relops/5.cc: Likewise.
* testsuite/experimental/optional/relops/6.cc: Likewise.
* testsuite/experimental/optional/requirements.cc: Likewise.
* testsuite/experimental/optional/swap/1.cc: Likewise.
* testsuite/experimental/optional/typedefs.cc: Likewise.
* testsuite/experimental/propagate_const/assignment/move.cc: Likewise.
* testsuite/experimental/propagate_const/assignment/move_neg.cc:
Likewise.
* testsuite/experimental/propagate_const/cons/move.cc: Likewise.
* testsuite/experimental/propagate_const/cons/move_neg.cc: Likewise.
* testsuite/experimental/propagate_const/hash/1.cc: Likewise.
* testsuite/experimental/propagate_const/observers/1.cc: Likewise.
* testsuite/experimental/propagate_const/relops/1.cc: Likewise.
* testsuite/experimental/propagate_const/requirements1.cc: Likewise.
* testsuite/experimental/propagate_const/requirements2.cc: Likewise.
* testsuite/experimental/propagate_const/requirements3.cc: Likewise.
* testsuite/experimental/propagate_const/requirements4.cc: Likewise.
* testsuite/experimental/propagate_const/requirements5.cc: Likewise.
* testsuite/experimental/propagate_const/swap/1.cc: Likewise.
* testsuite/experimental/propagate_const/typedefs.cc: Likewise.
* testsuite/experimental/random/randint.cc: Likewise.
* testsuite/experimental/ratio/value.cc: Likewise.
* testsuite/experimental/set/erasure.cc: Likewise.
* testsuite/experimental/string/erasure.cc: Likewise.
* testsuite/experimental/string_view/typedefs.cc: Likewise.
* testsuite/experimental/system_error/value.cc: Likewise.
* testsuite/experimental/tuple/tuple_size.cc: Likewise.
* testsuite/experimental/type_traits/value.cc: Likewise.
* testsuite/experimental/unordered_map/erasure.cc: Likewise.
* testsuite/experimental/unordered_set/erasure.cc: Likewise.
* testsuite/experimental/vector/erasure.cc: Likewise.
From-SVN: r242417
2016-11-15 14:33:41 +00:00
Jonathan Wakely
bf56b0b838
Add std::string constructor for substring of string_view (LWG 2742)
...
* doc/xml/manual/intro.xml: Document LWG 2742 status.
* doc/html/*: Regenerate.
* include/bits/basic_string.h
(basic_string(const T&, size_type, size_type, const Allocator&)): Add
constructor for substring of basic_string_view, as per LWG 2742 but
with additional constraint to fix ambiguity.
* testsuite/21_strings/basic_string/cons/char/9.cc: New test.
* testsuite/21_strings/basic_string/cons/wchar_t/9.cc: New test.
From-SVN: r242416
2016-11-15 14:33:20 +00:00
Jonathan Wakely
8b99f005cb
Constrain swap overload for std::optional (LWG 2748)
...
* doc/xml/manual/intro.xml: Document LWG 2748 status.
* include/std/optional (optional<T>::swap): Use is_nothrow_swappable_v
for exception specification.
(swap(optional<T>&, optional<T>&)): Disable when T is not swappable.
* testsuite/20_util/optional/swap/2.cc: New test.
From-SVN: r242415
2016-11-15 14:33:09 +00:00
Ville Voutilainen
6964bb3ed9
Implement P0513R0, Poisoning the Hash.
...
* include/bits/functional_hash.h (__poison_hash): New.
* include/bits/unique_ptr.h
(hash<unique_ptr<_Tp, _Dp>>): Derive from __poison_hash.
* include/std/optional (hash<optional<_Tp>>): Likewise.
* include/std/variant (hash<variant<_Types...>>): Likewise.
* testsuite/20_util/default_delete/48631_neg.cc: Adjust.
* testsuite/20_util/default_delete/void_neg.cc: Likewise.
* testsuite/20_util/optional/hash.cc: New.
* testsuite/20_util/unique_ptr/assign/48635_neg.cc: Adjust.
* testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc: Adjust.
* testsuite/20_util/unique_ptr/hash/1.cc: Add tests for
poisoned fancy pointer hashes.
* testsuite/20_util/variant/hash.cc: New.
From-SVN: r242402
2016-11-14 23:22:53 +02:00
Ville Voutilainen
627a2f5923
Implement P0504R0 (Revisiting in-place tag types for any/optional/variant).
...
Implement P0504R0 (Revisiting in-place tag types for
any/optional/variant).
* include/std/any (any(_ValueType&& __value)): Constrain
the __is_in_place_type with the decayed type.
(make_any): Adjust to use the new tag type.
* include/std/utility (in_place_tag): Remove.
(in_place_t): Turn into a non-reference tag type.
(__in_place, __in_place_type, __in_place_index): Remove.
(in_place): Turn into an inline variable of non-reference
tag type.
(in_place<_Tp>): Remove.
(in_place_index<_Idx>): Remove.
(in_place_type_t): New.
(in_place_type): Turn into a variable template of non-reference
type.
(in_place_index_t): New.
(in_place_index): Turn into a variable template of non-reference
type.
* include/std/variant
(_Variant_storage(in_place_index_t<_Np>, _Args&&...)): Adjust to
use the new tag type.
(_Union(in_place_index_t<0>, _Args&&...)): Likewise.
(_Union(in_place_index_t<_Np>, _Args&&...)): Likewise.
(_Variant_base()): Likewise.
(variant(_Tp&&)): Likewise.
(variant(in_place_type_t<_Tp>, _Args&&...)): Likewise.
(variant(in_place_type_t<_Tp>, initializer_list<_Up>,
_Args&&...)): Likewise.
(variant(in_place_index_t<_Np>, _Args&&...)): Likewise.
(variant(in_place_index_t<_Np>, initializer_list<_Up>,
_Args&&...)): Likewise
(variant(allocator_arg_t, const _Alloc&)): Likewise.
(variant(allocator_arg_t, const _Alloc&, _Tp&&)): Likewise.
(variant(allocator_arg_t, const _Alloc&, in_place_type_t<_Tp>,
_Args&&...)): Likewise.
(variant(allocator_arg_t, const _Alloc&, in_place_type_t<_Tp>,
initializer_list<_Up>, _Args&&...)): Likewise.
(variant(allocator_arg_t, const _Alloc&, in_place_index_t<_Np>,
_Args&&...)): Likewise.
(variant(allocator_arg_t, const _Alloc&, in_place_index_t<_Np>,
initializer_list<_Up>, _Args&&...)): Likewise.
(emplace(_Args&&...)): Likewise.
(emplace(initializer_list<_Up>, _Args&&...)): Likewise.
* testsuite/20_util/any/cons/explicit.cc: Likewise.
* testsuite/20_util/any/cons/in_place.cc: Likewise.
* testsuite/20_util/any/requirements.cc: Add tests to
check that any is not constructible from the new in_place_type_t
of any value category.
* testsuite/20_util/in_place/requirements.cc: Adjust to
use the new tag type.
* testsuite/20_util/variant/compile.cc: Likewise.
* testsuite/20_util/variant/run.cc: Likewise.
From-SVN: r242401
2016-11-14 22:47:44 +02:00
Ville Voutilainen
ca9e949f2e
Use constexpr addressof in optional, SFINAE housekeeping for any, optional and tuple.
...
Use constexpr addressof in optional, SFINAE housekeeping
for any, optional and tuple.
* include/std/any (__do_emplace(_Args&&...)): New.
(__do_emplace(initializer_list<_Up>, _Args&&...)): Likewise.
(__any_constructible): Likewise.
(__any_constructible_t): Use __any_constructible.
(operator=(_ValueType&&)): SFINAE in the return type.
(emplace(_Args&&...)): Likewise.
(emplace(initializer_list<_Up>, _Args&&...)): Likewise.
* include/std/optional (_Has_addressof_mem): Remove.
(_Has_addressof_free): Likewise.
(_Has_addressof): Likewise.
(__constexpr_addressof(_Tp&)): Likewise.
(operator->): Use std::__addressof.
* include/std/tuple (operator=(const tuple<_UElements...>&)):
SFINAE in return type.
(operator=(tuple<_UElements...>&&)): Likewise.
* testsuite/20_util/any/misc/any_cast_neg.cc: Adjust.
From-SVN: r242390
2016-11-14 17:30:37 +02:00
Jason Merrill
e7555e42d0
Improve various diagnostic issues.
...
* call.c (build_new_method_call_1): Include template arguments in
error message.
(print_error_for_call_failure): Likewise.
(build_new_function_call): Pass them in.
* name-lookup.c (supplement_binding_1): Don't complain about a
conflict with an erroneous declaration.
* error.c (dump_decl): Fix printing of alias declaration.
* decl.c (make_typename_type): Call cxx_incomplete_type_error.
* parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
* semantics.c (perform_koenig_lookup): Don't wrap an error in
TEMPLATE_ID_EXPR.
From-SVN: r242376
2016-11-13 23:58:45 -05:00
Jonathan Wakely
3ce968519a
Delete addressof for temporaries (LWG 2598)
...
* include/bits/move.h (addressof(const _Tp&&)): Add deleted overload,
as per LWG 2598.
From-SVN: r242375
2016-11-14 03:44:56 +00:00
Jonathan Wakely
9c52cc0189
Make std::future::share() noexcept (LWG 2556)
...
* include/std/future (future::share(), future<R&>::share())
(future<void>::share()): Add noexcept, as per LWG 2556.
From-SVN: r242374
2016-11-14 03:44:53 +00:00
Jonathan Wakely
881ca4c9de
PR78326 fix incorrect access of data member in base class
...
PR libstdc++/78326
* include/experimental/memory_resource (memory_resource::_S_max_align):
Change access to protected.
From-SVN: r242373
2016-11-14 02:00:26 +00:00
Jonathan Wakely
b2343559f2
Add array support to std::shared_ptr for C++17
...
* doc/xml/manual/status_cxx2017.xml: Update status.
* doc/html/manual/status.html: Regenerate.
* include/bits/shared_ptr.h (shared_ptr(unique_ptr<_Yp, _Del>)): Add
extension constructor to maintain C++14 behaviour.
* include/bits/shared_ptr_base.h (__sp_array_delete): Add new struct.
(__shared_count(_Ptr, false_type), __shared_count(_Ptr, true_type)):
New constructors.
(__sp_compatible_with, __sp_is_constructible): Add specializations
for array support.
(__sp_is_constructible_arr, __sp_is_constructible_arrN): New helpers.
(__shared_ptr_access): New base class for observer member functions.
(__shared_ptr::element_type): Use remove_extent.
(__shared_ptr::_UniqCompatible): Add __sp_compatible_with check.
(__shared_ptr(_Yp*)): Use tag dispatching to call new __shared_count
constructor.
(__shared_ptr(unique_ptr<_Yp, _Del>)): Add extension constructor.
(__shared_ptr::operator*, __shared_ptr::operator->): Remove and
inherit from __shared_ptr_access base class.
(__shared_ptr::__has_esft_base): Return false for array types.
(__weak_ptr::element_type): Use remove_extent.
* include/experimental/bits/shared_ptr.h (__libfund_v1): Remove.
(__shared_ptr<__libfund_v1<_Tp>>): Remove specializations.
(__wak_ptr<__libfund_v1<_Tp>>): Likewise.
(experimental::__sp_compatible_v): Redefine using
__sp_compatible_with.
(experimental::__sp_is_constructible_v): Redefine using
__sp_is_constructible.
(get_deleter, operator<<): Change argument from __shared_ptr to
shared_ptr.
* testsuite/20_util/shared_ptr/cons/array.cc: New test.
* testsuite/20_util/shared_ptr/cons/unique_ptr_array.cc: Adjust for
new behaviour.
* testsuite/20_util/shared_ptr/observers/array.cc: Test observers for
arrays.
* testsuite/20_util/shared_ptr/observers/array_neg.cc: New test.
From-SVN: r242369
2016-11-13 22:57:45 +00:00
Ville Voutilainen
1701800580
Implement P0403R1, Literal suffixes for basic_string_view.
...
* include/std/string_view
(operator""sv(const char*, size_t)): New.
(operator""sv(const wchar_t*, size_t)): Likewise.
(operator""sv(const char16_t*, size_t)): Likewise.
(operator""sv(const char32_t*, size_t)): Likewise.
* testsuite/21_strings/basic_string_view/literals/types.cc: New.
* testsuite/21_strings/basic_string_view/literals/values.cc: Likewise.
* testsuite/experimental/string_view/literals/values.cc: Add
tests for literals with embedded NULs.
From-SVN: r242367
2016-11-13 22:54:27 +02:00
Jason Merrill
ba1e69c03f
DR 374 - specialization in outer namespace
...
PR c++/56840
* pt.c (check_specialization_namespace): Allow any enclosing
namespace.
(check_unqualified_spec_or_inst): New.
(check_explicit_specialization): Call it.
* parser.c (cp_parser_elaborated_type_specifier)
(cp_parser_class_head): Call it.
From-SVN: r242348
2016-11-13 01:51:23 -05:00
Jonathan Wakely
5485c81829
* src/filesystem/ops.cc (is_empty): Fix typo in exception message.
...
From-SVN: r242341
2016-11-12 20:28:55 +00:00
Jonathan Wakely
13908b4404
* include/std/future (future_error): Fix public typo to private.
...
From-SVN: r242340
2016-11-12 20:28:50 +00:00
Jonathan Wakely
330cc73d98
Add std::future_error constructor from future_errc
...
* include/std/future (future_error): Make existing constructor
private and add constructor from future_errc.
From-SVN: r242334
2016-11-12 03:40:24 +00:00
Jonathan Wakely
0f88f1f2ab
Use shared_ptr<T>::element_type in hash specializations
...
* include/bits/shared_ptr.h (hash<shared_ptr<T>>): Use element_type.
* include/bits/shared_ptr_base.h (hash<__shared_ptr<T, L>>): Likewise.
From-SVN: r242333
2016-11-12 03:24:34 +00:00
François Dumont
28d1bf4464
debug.cc (format_word): Delete.
...
2016-11-10 François Dumont <fdumont@gcc.gnu.org>
* src/c++11/debug.cc (format_word): Delete.
(print_literal): New. Replace call to print_word for literals.
From-SVN: r242055
2016-11-10 21:29:43 +00:00
Tim Shen
7ce69e5a71
regex.h (regex_iterator::regex_iterator()): Define end() as _M_pregex == nullptr.
...
* libstdc++-v3/include/bits/regex.h (regex_iterator::regex_iterator()):
Define end() as _M_pregex == nullptr.
* libstdc++-v3/include/bits/regex.tcc (regex_iterator::operator==(),
regex_iterator::operator++()): Fix operator==() and operator++() to
look at null-ness of _M_pregex on both sides.
* testsuite/28_regex/regression.cc: New testcase.
From-SVN: r242025
2016-11-09 22:11:32 +00:00
Jason Merrill
51dc660315
Implement P0012R1, Make exception specifications part of the type system.
...
gcc/cp/
* cp-tree.h (enum tsubst_flags): Add tf_fndecl_type.
(flag_noexcept_type, ce_type): New.
* call.c (build_conv): Add ck_fnptr.
(enum conversion_kind): Change ck_tsafe to ck_fnptr.
(convert_like_real): Likewise.
(standard_conversion): Likewise. Allow function pointer
conversions for pointers to member functions.
(reference_compatible_p): Allow function pointer conversions.
(direct_reference_binding): Likewise.
(reference_binding): Reference-compatible is no longer a subset of
reference-related.
(is_subseq): Also strip ck_lvalue after next_conversion.
* class.c (instantiate_type): Check fnptr_conv_p.
(resolve_address_of_overloaded_function): Likewise.
* cvt.c (can_convert_tx_safety): Now static.
(noexcept_conv_p, fnptr_conv_p, strip_fnptr_conv): New.
* decl.c (flag_noexcept_type): Define.
(cxx_init_decl_processing): Set it.
(bad_specifiers): Check it.
(grokdeclarator) [cdk_function]: Add exception-spec to type here.
* lambda.c (maybe_add_lambda_conv_op): Add exception-spec to
returned pointer.
* mangle.c (struct globals): Add need_cxx1z_warning.
(mangle_decl): Check it.
(write_exception_spec): New.
(write_function_type): Call it.
(canonicalize_for_substitution): Handle exception spec.
(write_type): Likewise.
(write_encoding): Set processing_template_decl across mangling of
partially-instantiated type.
* pt.c (determine_specialization): Pass tf_fndecl_type.
(tsubst_decl, fn_type_unification): Likewise.
(tsubst): Strip tf_fndecl_type, pass it to
tsubst_exception_specification.
(convert_nontype_argument_function): Handle function pointer
conversion.
(convert_nontype_argument): Likewise.
(unify, for_each_template_parm_r): Walk into noexcept-specifier.
* rtti.c (ptr_initializer): Encode noexcept.
* tree.c (canonical_eh_spec): New.
(build_exception_variant): Use it.
* typeck.c (composite_pointer_type): Handle fnptr conversion.
(comp_except_specs): Compare canonical EH specs.
(structural_comptypes): Call it.
gcc/c-family/
* c.opt (Wc++1z-compat): New.
* c-cppbuiltin.c (c_cpp_builtins): Add __cpp_noexcept_function_type.
libstdc++-v3/
* include/bits/c++config (_GLIBCXX_NOEXCEPT_PARM)
(_GLIBCXX_NOEXCEPT_QUAL): New.
* include/std/type_traits (is_function): Use them.
* libsubc++/new (launder): Likewise.
* libsupc++/cxxabi.h (__pbase_type_info::__masks): Add
__noexcept_mask.
* libsupc++/pbase_type_info.cc (__do_catch): Handle function
pointer conversion.
libiberty/
* cp-demangle.c (is_fnqual_component_type): New.
(d_encoding, d_print_comp_inner, d_print_mod_list): Use it.
(FNQUAL_COMPONENT_CASE): New.
(d_make_comp, has_return_type, d_print_comp_inner)
(d_print_function_type): Use it.
(next_is_type_qual): New.
(d_cv_qualifiers, d_print_mod): Handle noexcept and throw-spec.
include/
* demangle.h (enum demangle_component_type): Add
DEMANGLE_COMPONENT_NOEXCEPT, DEMANGLE_COMPONENT_THROW_SPEC.
From-SVN: r241944
2016-11-07 18:09:29 -05:00
François Dumont
76d3fd72f1
gnu-versioned-namespace.ver: Export C++17 new of over-aligned types symbols.
...
2016-11-07 François Dumont <fdumont@gcc.gnu.org>
* config/abi/pre/gnu-versioned-namespace.ver: Export C++17 new of
over-aligned types symbols.
From-SVN: r241936
2016-11-07 21:12:36 +00:00
Jonathan Wakely
f0414b973f
Make filesystem::path work with basic_string_view (P0392R0)
...
* include/experimental/bits/fs_path.h (__is_path_src)
(_S_range_begin, _S_range_end): Overload to treat string_view as a
Source object.
(path::operator+=, path::compare): Overload for basic_string_view.
* testsuite/experimental/filesystem/path/construct/string_view.cc:
New test.
* testsuite/experimental/filesystem/path/construct/
string_view_cxx17.cc: New test.
From-SVN: r241658
2016-10-28 19:48:43 +01:00
Jonathan Wakely
fcfceb1afb
Fix filesystem::path for iterators with const value_type
...
* include/experimental/bits/fs_path.h
(path::_S_convert<_Iter>(_Iter, _Iter)): Remove cv-qualifiers from
iterator's value_type.
(path::_S_convert<_Iter>(_Iter __first, __null_terminated)): Likewise.
Do not use operation not supported by input iterators.
(path::__is_path_iter_src): Add partial specialization for const
encoded character types.
* testsuite/experimental/filesystem/path/construct/range.cc: Test
construction from input iterators with const value types.
From-SVN: r241654
2016-10-28 18:47:57 +01:00
Jonathan Wakely
1f5700e952
Implement std::launder for C++17
...
* doc/xml/manual/status_cxx2017.xml: Update status.
* doc/html/*: Regenerate.
* include/std/type_traits (has_unique_object_representations): Guard
with __has_builtin check.
* libsupc++/new (launder): Define for C++17.
* testsuite/18_support/launder/1.cc: New test.
* testsuite/18_support/launder/requirements.cc: New test.
* testsuite/18_support/launder/requirements_neg.cc: New test.
From-SVN: r241648
2016-10-28 15:09:33 +01:00
Uros Bizjak
47ffb5d95e
PR70975 Pass valid offset argument to sendfile
...
PR libstdc++/70975
* src/filesystem/ops.cc (do_copy_file) [_GLIBCXX_USE_SENDFILE]:
Pass non-null pointer to sendfile for offset argument.
From-SVN: r241629
2016-10-27 20:55:55 +02:00
Jonathan Wakely
e63d7e71a1
Fix target selectors in uniform_inside_sphere_distribution tests
...
* testsuite/ext/random/uniform_inside_sphere_distribution/cons/
default.cc: Fix effective target selector.
* testsuite/ext/random/uniform_inside_sphere_distribution/cons/
parms.cc: Likewise.
* testsuite/ext/random/uniform_inside_sphere_distribution/operators/
equal.cc: Likewise.
* testsuite/ext/random/uniform_inside_sphere_distribution/operators/
generate.cc: Likewise.
* testsuite/ext/random/uniform_inside_sphere_distribution/operators/
inequal.cc: Likewise.
* testsuite/ext/random/uniform_inside_sphere_distribution/operators/
serialize.cc: Likewise.
From-SVN: r241621
2016-10-27 14:55:36 +01:00
Jonathan Wakely
69af1c04e0
Adjust precision of filesystem::last_write_time tests
...
* testsuite/experimental/filesystem/iterators/directory_iterator.cc:
Use end() function to get end iterator.
* testsuite/experimental/filesystem/iterators/pop.cc: Remove printf
statements that were present for debugging.
* testsuite/experimental/filesystem/iterators/
recursive_directory_iterator.cc: Use end() function to get end
iterator.
* testsuite/experimental/filesystem/operations/last_write_time.cc:
Only require file timestamps to be accurate to one second.
From-SVN: r241616
2016-10-27 12:01:49 +01:00
François Dumont
d72c3f0a36
stl_map.h (map()): Make default.
...
2016-10-26 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_map.h (map()): Make default.
* include/bits/stl_multimap.h (multimap()): Likewise.
* include/bits/stl_multiset.h (multiset()): Likewise.
* include/bits/stl_set.h (set()): Likewise.
* include/bits/stl_tree.h (_Rb_tree_impl()): Add conditional noexcept.
(_Rb_tree()): Make default.
From-SVN: r241601
2016-10-26 20:52:21 +00:00
Bernd Edlinger
a0019047b8
re PR libstdc++/78110 (freestanding libstdc++ fails to compile)
...
2016-10-26 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR libstdc++/78110
* libsupc++/new_opa.cc: Don't include <malloc.h> in a free standing
environment. Declare memalign directly in that case.
From-SVN: r241591
2016-10-26 17:26:00 +00:00
Jonathan Wakely
790207d645
Fix test for recursive_directory_iterator::pop
...
* testsuite/experimental/filesystem/iterators/pop.cc: Remove
unreliable dependency on directory order.
From-SVN: r241583
2016-10-26 17:25:44 +01:00
Edward Smith-Rowland
10da5b7cbc
Implement uniform_inside_sphere_distribution extension.
...
2016-10-26 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement uniform_inside_sphere_distribution extension.
* include/ext/random: Implement uniform_inside_sphere_distribution.
* include/ext/random.tcc: Ditto.
* testsuite/ext/random/uniform_inside_sphere_distribution/
cons/default.cc: New.
* testsuite/ext/random/uniform_inside_sphere_distribution/
cons/parms.cc: New.
* testsuite/ext/random/uniform_inside_sphere_distribution/
operators/equal.cc: New.
* testsuite/ext/random/uniform_inside_sphere_distribution/
operators/generate.cc: New.
* testsuite/ext/random/uniform_inside_sphere_distribution/
operators/inequal.cc: New.
* testsuite/ext/random/uniform_inside_sphere_distribution/
operators/serialize.cc: New.
From-SVN: r241562
2016-10-26 15:34:18 +00:00
Jonathan Wakely
ec0b1056a7
Add recursive_directory_iterator::pop(error_code&)
...
* include/experimental/bits/fs_dir.h (recursive_directory_iterator):
Overload pop (LWG 2706).
* src/filesystem/dir.cc (recursive_directory_iterator::pop): Define
new overload.
* testsuite/experimental/filesystem/iterators/pop.cc: New test.
From-SVN: r241559
2016-10-26 16:20:04 +01:00
Jonathan Wakely
b4e7e6bf22
Fix error handling in recursive_directory_iterator::increment
...
* src/filesystem/dir.cc (recursive_directory_iterator::increment):
Reset state on error.
* testsuite/experimental/filesystem/iterators/
recursive_directory_iterator.cc: Check state after increment error.
From-SVN: r241552
2016-10-26 14:34:34 +01:00
Jonathan Wakely
9dbe100a41
PR78111 fix fallback code for filesystem::canonical
...
PR libstdc++/78111
* src/filesystem/ops.cc (canonical): Set error for non-existent path.
From-SVN: r241549
2016-10-26 12:29:36 +01:00
Uros Bizjak
d955ae42cc
Add missing header in Filesystem TS configure tests
...
2016-10-26 Uros Bizjak <ubizjak@gmail.com>
* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Include <limits.h>
for PATH_MAX in realpath test.
* configure: Regenerate.
From-SVN: r241548
2016-10-26 12:29:31 +01:00
Jonathan Wakely
7195dfe9b6
Handle negative times in filesystem::last_write_time
...
* src/filesystem/ops.cc
(last_write_time(const path&, file_time_type, error_code&)): Handle
negative times correctly.
* testsuite/experimental/filesystem/operations/last_write_time.cc:
Test writing file times.
From-SVN: r241522
2016-10-25 16:32:52 +01:00
Jonathan Wakely
ec04aad76d
Fix error handling in copy_file and equivalent
...
* src/filesystem/ops.cc (do_copy_file): Report an error if source or
destination is not a regular file (LWG 2712).
(equivalent): Fix error handling and result when only one file exists.
* testsuite/experimental/filesystem/operations/copy.cc: Remove files
created by tests. Test copying directories.
* testsuite/experimental/filesystem/operations/copy_file.cc: Remove
files created by tests.
* testsuite/experimental/filesystem/operations/equivalent.cc: New.
* testsuite/experimental/filesystem/operations/is_empty.cc: New.
* testsuite/experimental/filesystem/operations/read_symlink.cc: Remove
file created by test.
* testsuite/experimental/filesystem/operations/remove_all.cc: New.
* testsuite/util/testsuite_fs.h (~scoped_file): Only try to remove
file if path is non-empty, to support removal by other means.
From-SVN: r241521
2016-10-25 16:32:37 +01:00
Jonathan Wakely
94caf86019
Fix error handling in filesystem::is_empty
...
* src/filesystem/ops.cc (is_empty): Fix error handling.
* testsuite/experimental/filesystem/operations/is_empty.cc: New test.
From-SVN: r241488
2016-10-24 17:45:55 +01:00