David Edelsohn
d3861707eb
re PR libstdc++/83120 (ext/special_functions/hyperg failure on AIX)
...
PR libstdc++/83120
* testsuite/ext/special_functions/hyperg/check_value.cc: Add
-ffp-contract=off. Add -ffloat-store for m68* and ia32.
* testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_value.cc: Same.
From-SVN: r255483
2017-12-07 15:05:59 -05:00
Martin Sebor
5d9ae53d70
PR c/81544 - attribute noreturn and warn_unused_result on the same function accepted
...
PR c/81544 - attribute noreturn and warn_unused_result on the same function accepted
PR c/81566 - invalid attribute aligned accepted on functions
gcc/ada/ChangeLog:
PR c/81544
* gcc-interface/utils.c (gnat_internal_attribute_table): Initialize
new member of struct attribute_spec.
gcc/c/ChangeLog:
PR c/81544
* c-decl.c (c_decl_attributes): Look up existing declaration and
pass it to decl_attributes.
gcc/c-family/ChangeLog:
PR c/81544
PR c/81566
* c-attribs.c (attr_aligned_exclusions): New array.
(attr_alloc_exclusions, attr_cold_hot_exclusions): Same.
(attr_common_exclusions, attr_const_pure_exclusions): Same.
(attr_gnu_inline_exclusions, attr_inline_exclusions): Same.
(attr_noreturn_exclusions, attr_returns_twice_exclusions): Same.
(attr_warn_unused_result_exclusions): Same.
(handle_hot_attribute, handle_cold_attribute): Simplify.
(handle_const_attribute): Warn on function returning void.
(handle_pure_attribute): Same.
(handle_aligned_attribute): Diagnose conflicting attribute
specifications.
* c-warn.c (diagnose_mismatched_attributes): Simplify.
gcc/cp/ChangeLog:
PR c/81544
* cp-tree.h (decls_match): Add default argument.
* decl.c (decls_match): Avoid calling into the target back end
and triggering an error.
* decl2.c (cplus_decl_attributes): Look up existing declaration and
pass it to decl_attributes.
* tree.c (cxx_attribute_table): Initialize new member of struct
attribute_spec.
gcc/fortran/ChangeLog:
PR c/81544
* f95-lang.c (gfc_attribute_table): Initialize new member of struct
attribute_spec.
gcc/lto/ChangeLog:
PR c/81544
* lto-lang.c (lto_attribute_table): Initialize new member of struct
attribute_spec.
gcc/ChangeLog:
PR c/81544
* attribs.c (empty_attribute_table): Initialize new member of
struct attribute_spec.
(decl_attributes): Add argument. Handle mutually exclusive
combinations of attributes.
(selftests::test_attribute_exclusions): New function.
(selftests::attribute_c_tests): Ditto.
* attribs.h (decl_attributes): Add default argument.
* selftest.h (attribute_c_tests): Declare.
* selftest-run-tests.c (selftest::run_tests): Call attribute_c_tests.
* tree-core.h (attribute_spec::exclusions, exclude): New type and
member.
* doc/extend.texi (Common Function Attributes): Update const and pure.
gcc/testsuite/ChangeLog:
PR c/81544
* c-c++-common/Wattributes-2.c: New test.
* c-c++-common/Wattributes.c: New test.
* c-c++-common/attributes-3.c: Adjust.
* gcc.dg/Wattributes-6.c: New test.
* gcc.dg/Wattributes-7.c: New test.
* gcc.dg/attr-noinline.c
* gcc.dg/pr44964.c: Same.
* gcc.dg/torture/pr42363.c: Same.
* gcc.dg/tree-ssa/ssa-ccp-2.c: Same.
From-SVN: r255469
2017-12-07 09:32:03 -07:00
Jason Merrill
0382bcfcda
Correct noexcept mismatch in declarations.
...
2017-12-05 Jason Merrill <jason@redhat.com>
Jonathan Wakely <jwakely@redhat.com>
* include/bits/fs_fwd.h (copy, copy_file): Remove noexcept.
(permissions): Add noexcept.
* include/bits/fs_ops.h (permissions): Add noexcept.
* libsupc++/eh_throw.cc (__cxa_init_primary_exception): Add
_GLIBCXX_NOTHROW.
Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>
From-SVN: r255425
2017-12-05 15:23:26 +00:00
Jonathan Wakely
472a7639ea
Fix warnings in <bits/regex_compiler.tcc>
...
* include/bits/regex_compiler.tcc: Use C-style comment to work around
PR preprocessor/61638.
(__INSERT_REGEX_MATCHER): Replace GNU extension with __VA_ARGS__.
From-SVN: r255392
2017-12-04 23:08:22 +00:00
Jonathan Wakely
9ed83a33c0
Fix -Wunused warnings in libstdc++ headers
...
* config/io/basic_file_stdio.h (__basic_file): Remove name of unused
parameter.
* include/bits/boost_concept_check.h: Add pragmas to disable
-Wunused-local-typedef warnings.
* include/bits/codecvt.h (codecvt_byname<char16_t, char, mbstate_t>)
(codecvt_byname<char32_t, char, mbstate_t>): Remove name of unused
parameter.
* include/bits/locale_facets_nonio.tcc (time_get::do_get_weekday)
(time_get::do_get_monthname, time_get::do_get_year): Remove unused
variables.
* include/std/bitset (_Base_bitset<0>::_M_getword): Remove name of
unused parameter.
* include/std/streambuf (_IsUnused): Define.
(basic_streambuf::imbue, basic_streambuf::pbackfail)
(basic_streambuf::overflow): Add macro to unused parameters.
* testsuite/24_iterators/operations/prev_neg.cc: Adjust dg-error.
From-SVN: r255391
2017-12-04 23:07:39 +00:00
Jonathan Wakely
ad8fda29e6
Fix narrowing conversions in string_view types
...
* include/experimental/string_view (basic_string_view::_S_compare):
Use value-init so narrowing conversions are not ill-formed.
* include/std/string_view (basic_string_view::_S_compare): Likewise.
From-SVN: r255321
2017-12-01 16:10:31 +00:00
Jonathan Wakely
f03858e51d
Disable -Wliteral-suffix for standard UDLs
...
* include/bits/basic_string.h (operator""s): Add pragmas to disable
-Wliteral-suffix warnings.
* include/experimental/string_view (operator""sv): Likewise.
* include/std/chrono (operator""h, operator""min, operator""s)
(operator""ms, operator""us, operator""ns): Likewise.
* include/std/complex (operator""if, operator""i, operator""il):
Likewise.
* include/std/string_view (operator""sv): Likewise.
* testsuite/20_util/duration/literals/range.cc: Adjust dg-error.
From-SVN: r255320
2017-12-01 16:10:25 +00:00
Jonathan Wakely
ccd9a1e0ef
Add comment to fix -Wfallthrough warning
...
* include/bits/locale_facets_nonio.tcc (money_get::_M_extract): Add
fallthrough comment.
From-SVN: r255318
2017-12-01 15:10:23 +00:00
Jonathan Wakely
b7b61489b7
Fix -Wempty-body warnings for debug assertions
...
* include/bits/node_handle.h (_Node_handle_common::operator=)
(_Node_handle_common::_M_swap): Add braces around debug assertions.
From-SVN: r255317
2017-12-01 15:10:20 +00:00
Jonathan Wakely
f1338a2dcb
Use const char* to fix -Wwrite-strings warning
...
* include/ext/ropeimpl.h (rope::_S_dump): Use const char*.
From-SVN: r255316
2017-12-01 15:10:16 +00:00
Jonathan Wakely
c85d199208
Add [[noreturn]] attributes to fix warning
...
* libsupc++/nested_exception.h (__throw_with_nested_impl): Add
noreturn attribute.
From-SVN: r255315
2017-12-01 15:10:13 +00:00
Jonathan Wakely
071f228fa3
Remove stray semi-colons at namespace scope
...
* include/bits/regex_executor.tcc (_Executor::_M_rep_once_more):
Remove semi-colon after function body.
* include/bits/uniform_int_dist.h (_Power_of_2): Likewise.
From-SVN: r255314
2017-12-01 15:10:09 +00:00
Jonathan Wakely
e735008bf6
Use value-init syntax in std::__detail::__airy
...
* include/tr1/modified_bessel_func.tcc (__airy): Use value-init not
list-init.
From-SVN: r255313
2017-12-01 15:10:06 +00:00
Jonathan Wakely
352111c5b1
Add noexcept to std::integral_constant members
...
* include/std/type_traits (integral_constant): Make member functions
noexcept (LWG 2346).
* include/std/utility (integer_sequence): Likewise.
From-SVN: r255312
2017-12-01 15:09:57 +00:00
Jonathan Wakely
d44e1abee5
PR libstdc++/65927 Fix -Wunused-but-set-parameter warning
...
PR libstdc++/65927
* include/bits/locale_facets_nonio.h (__timepunct::_M_am_pm_format):
Remove statement with no effect.
From-SVN: r255278
2017-11-30 17:29:08 +00:00
Glen Joseph Fernandes
6b590c7a64
Move assertion from to_address to __to_address
...
2017-11-30 Glen Joseph Fernandes <glenjofe@gmail.com>
* include/bits/ptr_traits.h (__to_address, to_address): Move static
assertion.
* testsuite/20_util/to_address/1_neg.cc: New test.
From-SVN: r255277
2017-11-30 15:07:21 +00:00
Jonathan Wakely
5f939178ec
PR libstdc++/83226 avoid forming pointer-to-reference type
...
PR libstdc++/83226
* include/bits/node_handle.h (_Node_handle::__pointer): Avoid forming
pointer-to-reference types.
* testsuite/23_containers/map/modifiers/insert/83226.cc: New test.
From-SVN: r255271
2017-11-30 13:45:37 +00:00
John David Anglin
3be30be2c3
baseline_symbols.txt: Update.
...
* config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.
From-SVN: r255265
2017-11-30 00:53:16 +00:00
David Malcolm
591996bad7
C++: improve location of static_assert errors
...
gcc/cp/ChangeLog:
* parser.c (cp_parser_unary_expression): Generate a location for
"noexcept".
(cp_parser_trait_expr): Generate and return a location_t,
converting the return type from tree to cp_expr.
(cp_parser_static_assert): Pass location of the condition to
finish_static_assert, rather than that of the "static_assert"
token, where available.
gcc/testsuite/ChangeLog:
* g++.dg/cpp1y/static_assert3.C: New test case.
libstdc++-v3/ChangeLog:
* testsuite/20_util/duration/literals/range.cc: Update expected
line of a static_assert failure.
From-SVN: r255255
2017-11-29 22:07:32 +00:00
Glen Joseph Fernandes
61cd19e6be
Add std::to_address for C++2a (P0653R2)
...
2017-11-28 Glen Joseph Fernandes <glenjofe@gmail.com>
* include/bits/ptr_traits.h (to_address): Implement to_address.
* testsuite/20_util/to_address/1.cc: New test.
From-SVN: r255199
2017-11-28 14:22:32 +00:00
Stephan Bergmann
0f42ffd7f7
Add missing noexcept in string_view::find_first_of declaration
...
2017-11-27 Stephan Bergmann <sbergman@redhat.com>
* include/std/string_view (basic_string_view::find_first_of): Add
missing noexcept.
From-SVN: r255176
2017-11-27 19:43:40 +00:00
Stephan Bergmann
68e601d879
Fix std::unordered_map deduction guide
...
2017-11-27 Stephan Bergmann <sbergman@redhat.com>
* include/bits/unordered_map.h (unordered_map): Fix deduction guide.
* include/debug/unordered_map (unordered_map): Likewise.
From-SVN: r255174
2017-11-27 16:43:39 +00:00
Jonathan Wakely
a8541d9021
Add [[nodiscard]] attribute to std::launder
...
* libsupc++/new (launder): Add nodiscard attribute.
* testsuite/18_support/launder/nodiscard.cc: New test.
From-SVN: r255127
2017-11-24 00:00:46 +00:00
Jonathan Wakely
d69f1ec7d1
Add [[nodiscard]] attribute to C++17 components
...
* include/bits/fs_path.h (path::empty): Add nodiscard attribute.
* include/bits/range_access.h (empty): Likewise.
* include/std/string_view (basic_string_view::empty): Likewise.
* testsuite/21_strings/basic_string_view/capacity/empty_neg.cc: New
test.
* testsuite/24_iterators/range_access_cpp17_neg.cc: New test.
* testsuite/27_io/filesystem/path/query/empty_neg.cc: New test.
From-SVN: r255124
2017-11-23 22:11:21 +00:00
Jonathan Wakely
4b9840f230
PR libstdc++/83134 Ensure std::__not_ converts B::value to bool
...
PR libstdc++/83134
* include/std/type_traits (__not_): Explicitly convert to bool.
* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error.
* testsuite/20_util/logical_traits/83134.cc: New test.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust
dg-error.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
Likewise.
From-SVN: r255122
2017-11-23 21:35:27 +00:00
Jonathan Wakely
e350134d72
PR go/83102 relax std::set checks for invocable comparison object
...
PR go/83102
* include/bits/stl_tree.h (_Rb_tree): Relax invocable checks for
comparison object pre-C++17.
From-SVN: r255052
2017-11-22 11:06:15 +00:00
Jonathan Wakely
866e4d3853
PR libstdc++/48101 improve errors for invalid container specializations
...
PR libstdc++/48101
* include/bits/allocator.h (allocator<const _Tp>)
(allocator<volatile _Tp>, allocator<const volatile _Tp>): Add partial
specializations.
* include/bits/forward_list.h (forward_list): Add static assertions.
* include/bits/hashtable.h (__cache_default): Use
__is_nothrow_invocable instead of __is_noexcept_hash.
(_Hashtable): Add static assertions.
* include/bits/hashtable_policy.h (__is_noexcept_hash): Remove.
* include/bits/stl_deque.h (deque): Add static assertions.
* include/bits/stl_function.h (_Identity<const _Tp>): Add partial
specialization.
* include/bits/stl_list.h (list): Add static assertions.
* include/bits/stl_map.h (map): Likewise.
* 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): Likewise.
* include/bits/stl_vector.h (vector): Likewise.
* include/bits/unordered_map.h (unordered_map, unordered_multimap):
Use typename instead of class in template-parameter-list and remove
spaces.
* include/bits/unordered_set.h (unordered_set, unordered_multiset):
Likewise.
* testsuite/23_containers/deque/48101-2_neg.cc: New test.
* testsuite/23_containers/deque/48101_neg.cc: New test.
* testsuite/23_containers/forward_list/48101-2_neg.cc: New test.
* testsuite/23_containers/forward_list/48101_neg.cc: New test.
* testsuite/23_containers/list/48101-2_neg.cc: New test.
* testsuite/23_containers/list/48101_neg.cc: New test.
* testsuite/23_containers/map/48101-2_neg.cc: New test.
* testsuite/23_containers/map/48101_neg.cc: New test.
* testsuite/23_containers/map/operations/31440.cc: Fix comparison
object to have const-qualified call operator.
* testsuite/23_containers/multimap/48101-2_neg.cc: New test.
* testsuite/23_containers/multimap/48101_neg.cc: New test.
* testsuite/23_containers/multiset/48101-2_neg.cc: New test.
* testsuite/23_containers/multiset/48101_neg.cc: New test.
* testsuite/23_containers/set/48101-2_neg.cc: New test.
* testsuite/23_containers/set/48101_neg.cc: New test.
* testsuite/23_containers/unordered_map/48101-2_neg.cc: New test.
* testsuite/23_containers/unordered_map/48101_neg.cc: New test.
* testsuite/23_containers/unordered_multimap/48101-2_neg.cc: New test.
* testsuite/23_containers/unordered_multimap/48101_neg.cc: New test.
* testsuite/23_containers/unordered_multiset/48101-2_neg.cc: New test.
* testsuite/23_containers/unordered_multiset/48101_neg.cc: New test.
* testsuite/23_containers/unordered_set/48101-2_neg.cc: New test.
* testsuite/23_containers/unordered_set/48101_neg.cc: New test.
* testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust
dg-error line number.
* testsuite/23_containers/vector/48101-2_neg.cc: New test.
* testsuite/23_containers/vector/48101_neg.cc: New test.
From-SVN: r255035
2017-11-21 20:47:09 +00:00
Przemyslaw Wirkus
b99415b760
Fix invalid XML in libstdc++ manual
...
2017-11-21 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
* doc/xml/manual/using.xml (manual.intro.using.macros): Move
variablelist element at the end of its list.
From-SVN: r255023
2017-11-21 18:45:04 +00:00
Sebastian Huber
b76602dcf2
RTEMS: Enable some libstdc++ features
...
libstdc++/
* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Add rtems*.
(GLIBCXX_ENABLE_FILESYSTEM_TS): Likewise.
* configure: Regenerate.
From-SVN: r254985
2017-11-21 06:22:13 +00:00
François Dumont
e324f9cb92
streambuf_iterator.h (istreambuf_iterator<>): Declare std::advance for istreambuf_iterator of char types to be friend.
...
2017-11-20 François Dumont <fdumont@gcc.gnu.org>
* include/bits/streambuf_iterator.h (istreambuf_iterator<>): Declare
std::advance for istreambuf_iterator of char types to be friend.
(std::advance(istreambuf_iterator&, _Distance)): New overload.
* include/std/streambuf (basic_streambuf<>): Declare std::advance for
istreambuf_iterator of char types to be friend.
* testsuite/22_locale/money_get/get/char/9.cc: Have
istreambuf_iterator created on the fly when calling money_get<>::get.
* testsuite/22_locale/money_get/get/wchar_t/9.cc: Likewise.
* testsuite/24_iterators/istreambuf_iterator/debug/1_neg.cc: New.
* testsuite/24_iterators/istreambuf_iterator/debug/2_neg.cc: New.
* testsuite/25_algorithms/advance/istreambuf_iterators/char/1.cc: New.
* testsuite/25_algorithms/advance/istreambuf_iterators/char/1_neg.cc:
New.
* testsuite/25_algorithms/advance/istreambuf_iterators/char/2.cc: New.
* testsuite/25_algorithms/advance/istreambuf_iterators/char/2_neg.cc:
New.
* testsuite/25_algorithms/advance/istreambuf_iterators/char/3_neg.cc:
New.
* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/1.cc:
New.
* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/1_neg.cc:
New.
* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2.cc:
New.
* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2_neg.cc:
New.
* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/3_neg.cc:
New.
* testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc: Leverage
on std::advance overload.
* testsuite/25_algorithms/find/istreambuf_iterators/wchar_t/2.cc:
Likewise.
From-SVN: r254972
2017-11-20 22:30:28 +00:00
Jonathan Wakely
9be0a9d6d2
Fix failing tests caused by duplicate dg-options
...
* testsuite/special_functions/18_riemann_zeta/check_value.cc: Fix
duplicate dg-options directive.
* testsuite/tr1/5_numerical_facilities/special_functions/
20_riemann_zeta/check_value_neg.cc: Likewise.
From-SVN: r254971
2017-11-20 21:48:31 +00:00
Ville Voutilainen
7b7b60c830
Implement LWG 2353
...
* include/bits/stl_iterator_base_funcs.h (next):
Use InputIterator instead of ForwardIterator.
* testsuite/24_iterators/operations/lwg2353.cc: New.
* testsuite/24_iterators/operations/next_neg.cc: Remove.
From-SVN: r254957
2017-11-20 16:21:42 +02:00
Edward Smith-Rowland
b46881363f
PR libstdc++/pr66689 - comp_ellint_3 and ellint_3 return garbage values
...
2017-11-18 Edward Smith-Rowland <3dw4rd@verizon.net>
PR libstdc++/pr66689 - comp_ellint_3 and ellint_3 return garbage values
* include/tr1/ell_integral.tcc: Correct the nu sign convention
in ellint_3 and comp_ellint_3.
* testsuite/tr1/5_numerical_facilities/special_functions/
06_comp_ellint_3/check_value.cc: Regen with correct values.
* testsuite/tr1/5_numerical_facilities/special_functions/
14_ellint_3/check_value.cc: Ditto.
* testsuite/special_functions/06_comp_ellint_3/check_value.cc: Ditto.
* testsuite/special_functions/13_ellint_3/check_value.cc: Ditto.
* testsuite/tr1/5_numerical_facilities/special_functions/
01_assoc_laguerre/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
02_assoc_legendre/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
03_beta/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
04_comp_ellint_1/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
05_comp_ellint_2/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
07_conf_hyperg/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
08_cyl_bessel_i/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
09_cyl_bessel_j/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
10_cyl_bessel_k/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
11_cyl_neumann/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
12_ellint_1/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
13_ellint_2/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
15_expint/check_value_neg.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
16_hermite/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
17_hyperg/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
18_laguerre/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
19_legendre/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
20_riemann_zeta/check_value_neg.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
21_sph_bessel/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
22_sph_legendre/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
23_sph_neumann/check_value.cc: Regen.
* testsuite/ext/special_functions/conf_hyperg/check_value.cc: Regen.
* testsuite/ext/special_functions/hyperg/check_value.cc: Regen.
* testsuite/special_functions/01_assoc_laguerre/check_value.cc: Regen.
* testsuite/special_functions/02_assoc_legendre/check_value.cc: Regen.
* testsuite/special_functions/03_beta/check_value.cc: Regen.
* testsuite/special_functions/04_comp_ellint_1/check_value.cc: Regen.
* testsuite/special_functions/05_comp_ellint_2/check_value.cc: Regen.
* testsuite/special_functions/07_cyl_bessel_i/check_value.cc: Regen.
* testsuite/special_functions/08_cyl_bessel_j/check_value.cc: Regen.
* testsuite/special_functions/09_cyl_bessel_k/check_value.cc: Regen.
* testsuite/special_functions/10_cyl_neumann/check_value.cc: Regen.
* testsuite/special_functions/11_ellint_1/check_value.cc: Regen.
* testsuite/special_functions/12_ellint_2/check_value.cc: Regen.
* testsuite/special_functions/14_expint/check_value.cc: Regen.
* testsuite/special_functions/15_hermite/check_value.cc: Regen.
* testsuite/special_functions/16_laguerre/check_value.cc: Regen.
* testsuite/special_functions/17_legendre/check_value.cc: Regen.
* testsuite/special_functions/18_riemann_zeta/check_value.cc: Regen.
* testsuite/special_functions/19_sph_bessel/check_value.cc: Regen.
* testsuite/special_functions/20_sph_legendre/check_value.cc: Regen.
* testsuite/special_functions/21_sph_neumann/check_value.cc: Regen.
* testsuite/tr1/5_numerical_facilities/special_functions/
06_comp_ellint_3/pr66689.cc: New.
* testsuite/tr1/5_numerical_facilities/special_functions/
14_ellint_3/pr66689.cc: New.
* testsuite/special_functions/06_comp_ellint_3/pr66689.cc: New.
* testsuite/special_functions/13_ellint_3/pr66689.cc: New.
From-SVN: r254924
2017-11-19 01:01:50 +00:00
Edward Smith-Rowland
a7a389d6ee
specfun.h: Expose airy_ai and airy_bi.
...
2017-11-18 Edward Smith-Rowland <3dw4rd@verizon.net>
* include/bits/specfun.h: Expose airy_ai and airy_bi.
* include/tr1/modified_bessel_func.tcc: Treat NaN and inf arg, return.
* testsuite/ext/special_functions/airy_ai/check_nan.cc: New.
* testsuite/ext/special_functions/airy_ai/check_value.cc: New.
* testsuite/ext/special_functions/airy_ai/compile.cc: New.
* testsuite/ext/special_functions/airy_bi/check_nan.cc: New.
* testsuite/ext/special_functions/airy_bi/check_value.cc: New.
* testsuite/ext/special_functions/airy_bi/compile.cc: New.
From-SVN: r254917
2017-11-18 19:53:25 +00:00
Igor Tsimbalist
36101de964
Enable building libstdc++-v3 with Intel CET
...
libstdc++-v3/
* acinclude.m4: Add cet.m4.
* configure.ac: Set CET_FLAGS. Update EXTRA_CFLAGS,
EXTRA_CXX_FLAGS.
* libsupc++/Makefile.am: Use Add EXTRA_CFLAGS.
* Makefile.in: Regenerate.
* configure: Likewise.
* doc/Makefile.in: Likewise.
* include/Makefile.in: Likewise.
* libsupc++/Makefile.in: Likewise.
* po/Makefile.in: Likewise.
* python/Makefile.in: Likewise.
* src/Makefile.in: Likewise.
* src/c++11/Makefile.in: Likewise.
* src/c++98/Makefile.in: Likewise.
* src/filesystem/Makefile.in: Likewise.
* testsuite/Makefile.in: Likewise.
From-SVN: r254895
2017-11-17 22:28:10 +01:00
Jonathan Wakely
96e0367ead
PR libstdc++/83025 fix constraints for path overloads in <fstream>
...
PR libstdc++/83025
* include/std/fstream (basic_filebuf::_If_path): Move to
namespace-scope and rename to _If_fs_path.
(basic_filebuf::open): Use new name.
(basic_ifstream(_Path, ios::openmode))
(basic_ifstream::open(_Path, ios::openmode))
(basic_ofstream(_Path, ios::openmode))
(basic_ofstream::open(_Path, ios::openmode))
(basic_fstream(_Path, ios::openmode))
(basic_fstream::open(_Path, ios::openmode)): Use _If_fs_path.
* testsuite/27_io/basic_filebuf/open/char/path.cc: Test with filename
as non-const char*.
* testsuite/27_io/basic_fstream/cons/char/path.cc: Likewise.
* testsuite/27_io/basic_fstream/open/char/path.cc: Likewise.
* testsuite/27_io/basic_ifstream/cons/char/path.cc: Likewise.
* testsuite/27_io/basic_ifstream/open/char/path.cc: Likewise.
* testsuite/27_io/basic_ofstream/cons/char/path.cc: Likewise.
* testsuite/27_io/basic_ofstream/open/char/path.cc: Likewise.
From-SVN: r254871
2017-11-17 14:07:58 +00:00
Marc Glisse
c261ba2c8b
Tweak vector::_M_realloc_insert for code size
...
2017-11-17 Marc Glisse <marc.glisse@inria.fr>
* include/bits/vector.tcc (vector::_M_realloc_insert): Cache old
values before the allocation.
From-SVN: r254849
2017-11-16 23:51:20 +00:00
Jason Merrill
aef0c806eb
Remove wrong ChangeLog entry
...
From-SVN: r254831
2017-11-16 11:24:53 -05:00
Jonathan Wakely
a930324dab
Add noexcept to std::shared_future copy operations (LWG DR 2799)
...
* include/std/future (shared_future): Add noexcept to copy constructor
and copy-assignment operator (LWG 2799).
From-SVN: r254821
2017-11-16 14:39:41 +00:00
Jason Merrill
00a2022a67
* include/std/numeric (gcd): Fix typo.
...
From-SVN: r254794
2017-11-16 00:13:16 -05:00
Ville Voutilainen
865a86a0fd
Fix gcd breakage.
...
* include/std/numeric (gcd): Use remove_cv_t, not remove_cv.
From-SVN: r254785
2017-11-15 22:42:58 +02:00
Jonathan Wakely
4e6c429837
Minor improvements to Filesystem tests
...
* testsuite/27_io/filesystem/iterators/directory_iterator.cc: Leave
error_code unset.
* testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
Check for past-the-end before dereferencing.
* testsuite/experimental/filesystem/iterators/
recursive_directory_iterator.cc: Likewise.
From-SVN: r254781
2017-11-15 18:22:43 +00:00
Jonathan Wakely
1949122881
Add noexcept to generic std::size, std::empty and std::data
...
* include/bits/range_access.h (size, empty, data): Add conditional
noexcept to generic overloads.
From-SVN: r254779
2017-11-15 17:50:42 +00:00
Ville Voutilainen
13545f19e0
Implement LWG 2733 and LWG 2759
...
* include/experimental/numeric (gcd): Reject cv-qualified bool.
(lcm): Likewise.
* include/std/numeric (gcd): Likewise.
(lcm): Likewise.
* testsuite/26_numerics/gcd/gcd_neg.cc: Add tests and adjust.
* testsuite/26_numerics/lcm/lcm_neg.cc: Likewise.
From-SVN: r254736
2017-11-14 20:11:33 +02:00
Jonathan Wakely
d2e9196e5f
Fix typo in std::wbuffer_convert
...
* include/bits/locale_conv.h (wbuffer_convert::_M_conv_get): Fix typo.
* testsuite/22_locale/conversions/buffer/3.cc: New test.
From-SVN: r254735
2017-11-14 18:00:53 +00:00
Jonathan Wakely
34c71b8b3a
Minor tweak to libstdc++ testsuite helper type
...
* testsuite/util/testsuite_tr1.h (ThrowMoveConsClass): Use noexcept.
From-SVN: r254644
2017-11-11 00:10:07 +00:00
Jonathan Wakely
54df588530
PR libstdc++/82917 add missing returns in <fstream>
...
PR libstdc++/82917
* include/std/fstream (basic_ifstream::open, basic_ofstream::open)
(basic_fstream::open): Fix missing return.
From-SVN: r254638
2017-11-10 21:43:24 +00:00
Jonathan Wakely
d8dcc3a67d
Check for S_ISSOCK before use
...
* src/filesystem/ops-common.h (make_file_type) [S_ISSOCK]: Only use
S_ISSOCK when defined.
From-SVN: r254506
2017-11-07 19:08:06 +00:00
François Dumont
187e8ee733
tr1.cc: Compile with -O0.
...
2017-11-06 François Dumont <fdumont@gcc.gnu.org>
* testsuite/libstdc++-prettyprinters/tr1.cc: Compile with -O0.
From-SVN: r254477
2017-11-06 21:15:48 +00:00
Martin Liska
454f8b2b0c
Fix -Wreturn-type fallout.
...
2017-11-06 Martin Liska <mliska@suse.cz>
* c-c++-common/cilk-plus/AN/pr57541-2.c (foo1): Return a value
for functions with non-void return type, or change type to void,
or add -Wno-return-type for test.
(foo2): Likewise.
* c-c++-common/cilk-plus/AN/pr57541.c (foo): Likewise.
(foo1): Likewise.
* c-c++-common/cilk-plus/CK/errors.c: Likewise.
* c-c++-common/cilk-plus/CK/pr60197.c: Likewise.
* c-c++-common/cilk-plus/CK/spawn_in_return.c: Likewise.
* c-c++-common/fold-masked-cmp-1.c (test_pic): Likewise.
(test_exe): Likewise.
* c-c++-common/fold-masked-cmp-2.c (test_exe): Likewise.
* g++.dg/cilk-plus/AN/builtin_fn_mutating_tplt.cc (my_func): Likewise.
* g++.dg/cilk-plus/CK/pr68997.cc (fa2): Likewise.
* g++.dg/eh/sighandle.C (dosegv): Likewise.
* g++.dg/ext/vector14.C (foo): Likewise.
(main): Likewise.
* g++.dg/graphite/pr41305.C: Likewise.
* g++.dg/graphite/pr42930.C: Likewise.
* g++.dg/opt/pr46640.C (struct QBasicAtomicInt): Likewise.
(makeDir): Likewise.
* g++.dg/other/i386-8.C (foo): Likewise.
* g++.dg/pr45788.C: Likewise.
* g++.dg/pr64688.C (at_c): Likewise.
* g++.dg/pr65032.C (G::DecodeVorbis): Likewise.
* g++.dg/pr71633.C (c3::fn2): Likewise.
* g++.dg/stackprotectexplicit2.C (A): Likewise.
* g++.old-deja/g++.law/weak.C (main): Likewise.
2017-11-06 Martin Liska <mliska@suse.cz>
* testsuite/libgomp.c++/loop-2.C: Return a value
for functions with non-void return type, or change type to void,
or add -Wno-return-type for test.
* testsuite/libgomp.c++/loop-4.C: Likewise.
* testsuite/libgomp.c++/parallel-1.C: Likewise.
* testsuite/libgomp.c++/shared-1.C: Likewise.
* testsuite/libgomp.c++/single-1.C: Likewise.
* testsuite/libgomp.c++/single-2.C: Likewise.
2017-11-06 Martin Liska <mliska@suse.cz>
* testsuite/27_io/basic_fstream/cons/char/path.cc (main):
Return a value for functions with non-void return type,
or change type to void, or add -Wno-return-type for test.
* testsuite/27_io/basic_ifstream/cons/char/path.cc (main):
Likewise.
* testsuite/27_io/basic_ofstream/open/char/path.cc (main):
Likewise.
From-SVN: r254451
2017-11-06 13:41:35 +00:00
Paolo Carlini
98910bc2b9
deduction.cc: Avoid -Wreturn-type warnings.
...
2017-11-06 Paolo Carlini <paolo.carlini@oracle.com>
* testsuite/20_util/optional/cons/deduction.cc: Avoid -Wreturn-type
warnings.
* testsuite/20_util/pair/cons/deduction.cc: Likewise.
* testsuite/20_util/pair/traits.cc: Likewise.
* testsuite/20_util/tuple/cons/deduction.cc: Likewise.
* testsuite/20_util/variant/compile.cc: Likewise.
* testsuite/23_containers/map/modifiers/try_emplace/1.cc: Likewise.
* testsuite/23_containers/unordered_map/modifiers/try_emplace.cc:
Likewise.
From-SVN: r254450
2017-11-06 12:55:35 +00:00
Gerald Pfeifer
ba89e5d5a7
* doc/xml/manual/abi.xml: Move docs.oracle.com references to https.
...
From-SVN: r254426
2017-11-05 11:14:38 +00:00
Jonathan Wakely
e641ee437f
Define std::endian for C++2a (P0463R1)
...
* include/std/type_traits (endian): Define new enumeration type.
* testsuite/20_util/endian/1.cc: New test.
From-SVN: r254381
2017-11-03 15:45:49 +00:00
Jonathan Wakely
97695d99b0
Remove _Node_insert_return::get() member functions (P0508R0)
...
* include/bits/node_handle.h (_Node_insert_return::get): Remove, as
per P0508R0.
From-SVN: r254368
2017-11-03 11:04:45 +00:00
François Dumont
86397ed17c
printers.py (StdExpAnyPrinter.__init__): Strip typename versioned namespace before the substitution.
...
2017-11-01 François Dumont <fdumont@gcc.gnu.org>
* python/libstdcxx/v6/printers.py (StdExpAnyPrinter.__init__): Strip
typename versioned namespace before the substitution.
(StdExpOptionalPrinter.__init__): Likewise.
(StdVariantPrinter.__init__): Likewise.
(Printer.add_version): Inject versioned namespace after std or
__gnu_cxx.
(build_libstdcxx_dictionary): Adapt add_version usages, always pass
namespace first and symbol second.
From-SVN: r254320
2017-11-01 17:52:05 +00:00
Jonathan Wakely
50e248f0c8
PR libstdc++/82777 fix path normalization for dot-dot
...
PR libstdc++/82777
* src/filesystem/std-path.cc (path::lexically_normal): Remove dot-dot
elements correctly.
* testsuite/27_io/filesystem/path/generation/normal.cc: Add testcase.
* testsuite/util/testsuite_fs.h (compare_paths): Improve exception
text.
From-SVN: r254317
2017-11-01 17:09:14 +00:00
Jonathan Wakely
97b99f9c77
Don't create broken symlink in libstdc++-v3/include/bits
...
* include/Makefile.am (stamp-bits-sup): Do not create broken symlink
to stamp-bits.
* include/Makefile.in: Regenerate.
From-SVN: r254229
2017-10-30 16:28:13 +00:00
Jonathan Wakely
0a6e98b78b
Remove ios_mode::trunc from basic_ofstream openmode arguments
...
* include/std/fstream (basic_ifstream, basic_ofstream, basic_fstream):
Remove outdated comments about calling c_str() to create a file stream
from a std::string.
(basic_ofstream::basic_ofstream, basic_ofstream::open): Remove
redundant ios_mode::trunc bits from default arguments and comments.
From-SVN: r254226
2017-10-30 15:35:02 +00:00
Jonathan Wakely
932bfa9bc7
Minor tweak to libstdc++ FAQ
...
* doc/xml/faq.xml: Adjust "What is libstdc++?" answer slightly.
From-SVN: r254224
2017-10-30 14:56:23 +00:00
Jonathan Wakely
02a2c6303f
Minor header reorganization for unordered containers
...
* include/bits/hashtable_policy.h: Include <tuple>.
* include/std/unordered_map: Only include <bits/stl_pair.h> instead
of <utility> and <tuple>.
* include/std/unordered_set: Likewise.
From-SVN: r254223
2017-10-30 14:54:28 +00:00
Ville Voutilainen
ccbbf8df05
Implement LWG 2485
...
* include/debug/array (get(const array<_Tp, _Nm>&&)): New.
* include/std/array (get(const array<_Tp, _Nm>&&)): Likewise.
* include/std/tuple (get(const tuple<_Elements...>&&)): Likewise.
(get(const tuple<_Types...>&&)): Likewise.
* include/std/utility
(__pair_get::__const_move_get(const std::pair<_Tp1, _Tp2>&&)):
Likewise.
(get(const std::pair<_Tp1, _Tp2>&&)): Likewise.
(get(const pair<_Tp, _Up>&&)): Likewise.
(get(const pair<_Up, _Tp>&&)): Likewise.
* testsuite/20_util/pair/astuple/get.cc: Add tests for
new overloads.
* testsuite/20_util/pair/astuple/get_by_type.cc: Likewise.
* testsuite/20_util/tuple/element_access/get2.cc: Likewise.
* testsuite/20_util/tuple/element_access/get2_by_type.cc: Likewise.
* testsuite/23_containers/array/tuple_interface/get.cc: Likewise.
* testsuite/23_containers/array/tuple_interface/tuple_element_debug_neg.cc:
Adjust.
* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
Likewise.
From-SVN: r254222
2017-10-30 16:31:04 +02:00
Jonathan Wakely
6c6705a904
Simplify _Node_insert_return to avoid including <tuple>
...
* include/bits/node_handle.h (_Node_insert_return::get): Avoid
use of std::tie and std::get.
From-SVN: r254162
2017-10-27 18:49:36 +01:00
Jonathan Wakely
5880ce184a
List headers in Makefile in alphabetical order
...
* include/Makefile.am: Put headers in alphabetical order.
* include/Makefile.in: Regenerate.
From-SVN: r254161
2017-10-27 18:49:32 +01:00
Jonathan Wakely
29453a9ffd
Remove noexcept from filesystem iterators and operations (LWG 3013, 3014)
...
* include/bits/fs_dir.h (directory_iterator): Remove noexcept from
constructors and increment member (LWG 3013).
(recursive_directory_iterator): Likewise.
* include/bits/fs_ops.h (copy, copy_file, create_directories)
(is_empty, remove_all): Remove noexcept (LWG 3013 and LWG 3014).
* src/filesystem/std-dir.cc (directory_iterator::increment)
(recursive_directory_iterator::increment): Remove noexcept.
* src/filesystem/std-ops.cc (copy, copy_file, create_directories)
(is_empty, remove_all): Remove noexcept
From-SVN: r254160
2017-10-27 18:49:29 +01:00
Jonathan Wakely
9a3effa411
Make filesystem::file_status default constructor non-explicit (LWG 2787)
...
* include/bits/fs_dir.h (file_status): Make default constructor
non-explicit (LWG 2787).
* testsuite/27_io/filesystem/file_status/1.cc: New test.
* testsuite/experimental/filesystem/file_status/1.cc: New test.
From-SVN: r254159
2017-10-27 18:49:21 +01:00
Jonathan Wakely
d49f254a6c
Provide filesystem::path overloads for file streams (LWG 2676, partial)
...
* include/std/fstream (basic_filebuf::_If_path): New SFINAE helper.
(basic_filebuf::open<Path>(const Path&, const ios_base::openmode&))
(basic_ifstream<Path>(const Path&, const ios_base::openmode&))
(basic_ifstream::open<Path>(const Path&, const ios_base::openmode&))
(basic_ofstream<Path>(const Path&, const ios_base::openmode&))
(basic_ofstream::open<Path>(const Path&, const ios_base::openmode&))
(basic_fstream<Path>(const Path&, const ios_base::openmode&))
(basic_fstream::open<Path>(const Path&, const ios_base::openmode&)):
New constructors and member functions.
* testsuite/27_io/basic_filebuf/open/char/path.cc: New test.
* testsuite/27_io/basic_fstream/cons/char/path.cc: New test.
* testsuite/27_io/basic_fstream/open/char/path.cc: New test.
* testsuite/27_io/basic_ifstream/cons/char/path.cc: New test.
* testsuite/27_io/basic_ifstream/open/char/path.cc: New test.
* testsuite/27_io/basic_ofstream/cons/char/path.cc: New test.
* testsuite/27_io/basic_ofstream/open/char/path.cc: New test.
From-SVN: r254148
2017-10-27 13:39:01 +01:00
Jonathan Wakely
0348dd008a
Define std::filesystem::path::format enum (P0430R2)
...
* include/bits/fs_path.h (path::format): Define new enumeration type.
(path(string_type&&), path<Source>(const Source&))
(path<InputIterator>(InputIterator, InputIterator))
(path<Source>(const Source&, const locale&))
(path<InputIterator>(InputIterator, InputIterator, const locale&)):
Add format parameter.
* testsuite/27_io/filesystem/path/construct/format.cc: New test.
From-SVN: r254144
2017-10-27 13:01:49 +01:00
Jonathan Wakely
d67be4437a
Protect more algorithms from overloaded comma operators
...
* include/bits/stl_algo.h (__find_if_not_n, generate_n): Cast to void
to ensure overloaded comma not used.
* include/bits/stl_algobase.h (__fill_n_a, equal): Likewise.
* include/bits/stl_uninitialized.h (__uninitialized_fill_n)
(__uninitialized_fill_n_a, __uninitialized_default_n_1)
(__uninitialized_default_n_a, __uninitialized_copy_n)
(__uninitialized_copy_n_pair): Likewise
* testsuite/20_util/specialized_algorithms/memory_management_tools/1.cc:
Use test iterator wrappers with overloaded comma operator.
* testsuite/25_algorithms/fill_n/1.cc: Likewise.
* testsuite/25_algorithms/generate_n/1.cc: New test.
* testsuite/25_algorithms/stable_partition/1.cc: New test.
* testsuite/util/testsuite_iterators.h (operator,): Add deleted
non-member comma operator with iterator wrappers as right operand.
From-SVN: r254128
2017-10-27 00:50:40 +01:00
Ville Voutilainen
957f5feacf
Deduction guides for associative containers, debug mode deduction guide fixes.
...
* include/bits/stl_iterator.h (__iter_key_t)
(__iter_val_t, __iter_to_alloc_t): New.
* include/bits/stl_map.h: Add deduction guides.
* include/bits/stl_multimap.h: Likewise.
* include/bits/stl_multiset.h: Likewise.
* include/bits/stl_set.h: Likewise.
* include/bits/unordered_map.h: Likewise.
* include/bits/unordered_set.h: Likewise.
* include/debug/deque: Likewise.
* include/debug/forward_list: Likewise.
* include/debug/list: Likewise.
* include/debug/map.h: Likewise.
* include/debug/multimap.h: Likewise.
* include/debug/multiset.h: Likewise.
* include/debug/set.h: Likewise.
* include/debug/unordered_map: Likewise.
* include/debug/unordered_set: Likewise.
* include/debug/vector: Likewise.
* testsuite/23_containers/map/cons/deduction.cc: New.
* testsuite/23_containers/multimap/cons/deduction.cc: Likewise.
* testsuite/23_containers/multiset/cons/deduction.cc: Likewise.
* testsuite/23_containers/set/cons/deduction.cc: Likewise.
* testsuite/23_containers/unordered_map/cons/deduction.cc: Likewise.
* testsuite/23_containers/unordered_multimap/cons/deduction.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/cons/deduction.cc:
Likewise.
* testsuite/23_containers/unordered_set/cons/deduction.cc: Likewise.
From-SVN: r254113
2017-10-26 19:42:31 +03:00
Jonathan Wakely
5fdbeb16d7
Update C++17 library status documentation
...
* doc/xml/manual/status_cxx2017.xml: Update C++17 status, and
information on feature-test macros.
* doc/html/*: Regenerate.
From-SVN: r254078
2017-10-25 15:06:12 +01:00
Jonathan Wakely
30e0aed183
PR libstdc++/82716 avoid stupid -Wmismatched-tags warnings
...
PR libstdc++/82716
* include/std/array (tuple_size, tuple_element): Change class-key
from class to struct, to avoid annoying Clang warnings.
From-SVN: r254077
2017-10-25 14:55:56 +01:00
Jonathan Wakely
220645d019
PR libstdc++/79283 fix filesystem::read_symlink for /proc
...
PR libstdc++/79283
* src/filesystem/ops.cc (read_symlink): Handle st_size being zero.
* src/filesystem/std-ops.cc (read_symlink): Likewise.
(do_copy_file) [!NEED_DO_COPY_FILE]: Avoid multiple definitions.
From-SVN: r254076
2017-10-25 13:42:58 +01:00
Jonathan Wakely
eeb517d3e7
Fix filesystem::path::lexically_normal algorithm
...
* src/filesystem/std-path.cc (path::lexically_normal): Add missing
step to algorithm, for removing dot-dot elements after root-directory.
* testsuite/27_io/filesystem/operations/canonical.cc: Use
compare_paths for more exhaustive checks.
* testsuite/27_io/filesystem/operations/proximate.cc: Likewise.
* testsuite/27_io/filesystem/path/append/path.cc: Likewise.
* testsuite/27_io/filesystem/path/concat/path.cc: Likewise.
* testsuite/27_io/filesystem/path/concat/strings.cc: Fix comment.
* testsuite/27_io/filesystem/path/construct/locale.cc: Likewise.
* testsuite/27_io/filesystem/path/decompose/root_directory.cc:
Likewise.
* testsuite/27_io/filesystem/path/generation/normal.cc: Use
compare_paths for more exhaustive checks. Add extra testcases.
* testsuite/27_io/filesystem/path/generation/proximate.cc: Use
compare_paths for more exhaustive checks.
* testsuite/27_io/filesystem/path/generation/relative.cc: Likewise.
* testsuite/27_io/filesystem/path/generic/generic_string.cc: Remove
unused header.
* testsuite/27_io/filesystem/path/modifiers/make_preferred.cc: Fix
comment.
* testsuite/27_io/filesystem/path/modifiers/remove_filename.cc: Use
compare_paths for more exhaustive checks.
* testsuite/27_io/filesystem/path/modifiers/replace_extension.cc:
Likewise.
* testsuite/27_io/filesystem/path/modifiers/replace_filename.cc:
Likewise.
* testsuite/util/testsuite_fs.h (compare_paths): Also compare native
strings.
From-SVN: r254075
2017-10-25 13:42:53 +01:00
Jonathan Wakely
e921c7e5a6
PR libstdc++/82706 fix test for case where operations succeed
...
PR libstdc++/82706
* testsuite/27_io/filesystem/operations/permissions.cc: Fix test.
From-SVN: r254067
2017-10-25 01:27:10 +01:00
François Dumont
8468bfe8cb
libstdc++.exp (check_v3_target_normal_mode): Add c++config.h include.
...
2017-10-24 François Dumont <fdumont@gcc.gnu.org>
* testsuite/lib/libstdc++.exp (check_v3_target_normal_mode): Add
c++config.h include.
(check_v3_target_normal_namespace): New.
* testsuite/lib/dg-options.exp (dg-require-normal-namespace): New.
* testsuite/18_support/headers/limits/synopsis.cc: Add latter.
* testsuite/20_util/from_chars/requirements.cc: Likewise.
* testsuite/20_util/headers/functional/synopsis.cc: Likewise.
* testsuite/20_util/headers/memory/synopsis.cc: Likewise.
* testsuite/20_util/headers/utility/synopsis.cc: Likewise.
* testsuite/20_util/to_chars/requirements.cc: Likewise.
* testsuite/21_strings/headers/string/synopsis.cc: Likewise.
* testsuite/22_locale/headers/locale/synopsis.cc: Likewise.
* testsuite/23_containers/headers/bitset/synopsis.cc: Likewise.
* testsuite/23_containers/headers/deque/synopsis.cc: Likewise.
* testsuite/23_containers/headers/forward_list/synopsis.cc: Likewise.
* testsuite/23_containers/headers/list/synopsis.cc: Likewise.
* testsuite/23_containers/headers/map/synopsis.cc: Likewise.
* testsuite/23_containers/headers/queue/synopsis.cc: Likewise.
* testsuite/23_containers/headers/set/synopsis.cc: Likewise.
* testsuite/23_containers/headers/stack/synopsis.cc: Likewise.
* testsuite/23_containers/headers/vector/synopsis.cc: Likewise.
* testsuite/23_containers/map/modifiers/erase/abi_tag.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/erase/abi_tag.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/erase/abi_tag.cc: Likewise.
* testsuite/23_containers/set/modifiers/erase/abi_tag.cc: Likewise.
* testsuite/24_iterators/headers/iterator/synopsis.cc: Likewise.
* testsuite/24_iterators/headers/iterator/synopsis_c++11.cc: Likewise.
* testsuite/24_iterators/headers/iterator/synopsis_c++14.cc: Likewise.
* testsuite/24_iterators/headers/iterator/synopsis_c++17.cc: Likewise.
* testsuite/26_numerics/complex/abi_tag.cc: Likewise.
* testsuite/26_numerics/headers/complex/synopsis.cc: Likewise.
* testsuite/26_numerics/headers/valarray/synopsis.cc: Likewise.
* testsuite/27_io/headers/fstream/synopsis.cc: Likewise.
* testsuite/27_io/headers/ios/synopsis.cc: Likewise.
* testsuite/27_io/headers/istream/synopsis.cc: Likewise.
* testsuite/27_io/headers/ostream/synopsis.cc: Likewise.
* testsuite/27_io/headers/sstream/synopsis.cc: Likewise.
* testsuite/27_io/headers/streambuf/synopsis.cc: Likewise.
From-SVN: r254060
2017-10-24 20:20:12 +00:00
Jonathan Wakely
d56a36834f
Avoid -Wattribute-alias warnings for long double compat symbols
...
* config/locale/gnu/c_locale.cc [_GLIBCXX_LONG_DOUBLE_COMPAT]: Ignore
-Wattribute-alias warnings.
* src/c++11/istream-inst.cc: Likewise.
* src/c++11/locale-inst.cc: Likewise.
* src/c++11/ostream-inst.cc: Likewise.
* src/c++11/wlocale-inst.cc: Likewise.
* src/c++98/hash-long-double-tr1-aux.cc: Likewise.
From-SVN: r254045
2017-10-24 14:18:59 +01:00
Jonathan Wakely
02e2a7d8ef
Refactor std::basic_string_view members and add noexcept
...
* include/bits/string_view.tcc (find_first_of, find_last_of)
(find_first_not_of, find_last_not_of): Add noexcept.
* include/std/string_view (basic_string_view(const _CharT*))
(basic_string_view(const _CharT*, size_type))
(front, back, remove_prefix, remove_suffix, find, rfind)
(find_first_of, find_first_not_of): Add noexcept.
(at(size_type), _S_compare(size_type, size_type)): Replace conditional
expressions with if statements.
(copy(_CharT*, size_type, size_type), substr(size_type, size_type)):
Use _M_check for length checks.
(compare(basic_string_view)): Reformat.
(_M_check(size_type, const char)): Add noexcept(false).
(_M_limit(size_type, size_type)): Use noexcept not _GLIBCXX_NOEXCEPT.
From-SVN: r254044
2017-10-24 14:18:52 +01:00
Jonathan Wakely
6a19d2a2ee
PR libstdc++/82685 add 'noexcept' to string_view literals
...
PR libstdc++/82685
* include/experimental/string_view (operator""sv): Add noexcept.
* include/std/string_view (operator""sv): Likewise.
From-SVN: r254041
2017-10-24 12:28:40 +01:00
Jonathan Wakely
641cb5a675
Implement C++17 Filesystem library
...
Based on Filesystem TS implementation, with the changes applied by:
- P0219R1 Relative Paths for Filesystem
- P0317R1 Directory Entry Caching for Filesystem
- P0492R2 Resolution of C++17 National Body Comments
Where appropriate code is shared between the TS and C++17
implementations.
* include/Makefile.am: Add new headers for C++17 filesystem library.
* include/Makefile.in: Regenerate.
* include/bits/fs_dir.h: New header, based on Filesystem TS code in
include/experimental/bits directory.
* include/bits/fs_fwd.h: Likewise.
* include/bits/fs_ops.h: Likewise.
* include/bits/fs_path.h: Likewise.
* include/experimental/bits/fs_dir.h: Rename Doxygen group.
* include/experimental/bits/fs_fwd.h: Likewise.
* include/experimental/bits/fs_ops.h: Likewise.
* include/experimental/bits/fs_path.h: Likewise.
* include/experimental/filesystem (filesystem_error::_M_gen_what):
Remove inline definition.
* include/precompiled/stdc++.h: Add <filesystem> to precompiled
header.
* include/std/filesystem: New header.
* python/libstdcxx/v6/printers.py: Enable printer for std::filesystem
paths.
* src/filesystem/Makefile.am: Add new files. Compile as C++17.
* src/filesystem/Makefile.in: Regenerate.
* src/filesystem/cow-dir.cc: Update comment.
* src/filesystem/cow-ops.cc: Likewise.
* src/filesystem/cow-path.cc: Likewise.
* src/filesystem/cow-std-dir.cc: New file.
* src/filesystem/cow-std-ops.cc: New file.
* src/filesystem/cow-std-path.cc: New file.
* src/filesystem/dir-common.h (_Dir_base, get_file_type): New header
for common code.
* src/filesystem/dir.cc (_Dir): Derive from _Dir_base.
(open_dir): Move to _Dir_base constructor.
(get_file_type): Move to dir-common.h.
(recurse): Move to _Dir_base::should_recurse.
* src/filesystem/ops-common.h: New header for common code.
* src/filesystem/ops.cc (is_set, make_file_type, make_file_status)
(is_not_found_errno, file_time, do_copy_file): Move to ops-common.h.
* src/filesystem/path.cc (filesystem_error::_M_gen_what): Define.
* src/filesystem/std-dir.cc: New file, based on Filesystem TS code.
* src/filesystem/std-ops.cc: Likewise.
* src/filesystem/std-dir.cc: Likewise.
* testsuite/27_io/filesystem/iterators/directory_iterator.cc: New
test.
* testsuite/27_io/filesystem/iterators/pop.cc: New test.
* testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
New test.
* testsuite/27_io/filesystem/operations/absolute.cc: New test.
* testsuite/27_io/filesystem/operations/canonical.cc: New test.
* testsuite/27_io/filesystem/operations/copy.cc: New test.
* testsuite/27_io/filesystem/operations/copy_file.cc: New test.
* testsuite/27_io/filesystem/operations/create_directories.cc: New
test.
* testsuite/27_io/filesystem/operations/create_directory.cc: New test.
* testsuite/27_io/filesystem/operations/create_symlink.cc: New test.
* testsuite/27_io/filesystem/operations/current_path.cc: New test.
* testsuite/27_io/filesystem/operations/equivalent.cc: New test.
* testsuite/27_io/filesystem/operations/exists.cc: New test.
* testsuite/27_io/filesystem/operations/file_size.cc: New test.
* testsuite/27_io/filesystem/operations/is_empty.cc: New test.
* testsuite/27_io/filesystem/operations/last_write_time.cc: New test.
* testsuite/27_io/filesystem/operations/permissions.cc: New test.
* testsuite/27_io/filesystem/operations/proximate.cc: New test.
* testsuite/27_io/filesystem/operations/read_symlink.cc: New test.
* testsuite/27_io/filesystem/operations/relative.cc: New test.
* testsuite/27_io/filesystem/operations/remove_all.cc: New test.
* testsuite/27_io/filesystem/operations/space.cc: New test.
* testsuite/27_io/filesystem/operations/status.cc: New test.
* testsuite/27_io/filesystem/operations/symlink_status.cc: New test.
* testsuite/27_io/filesystem/operations/temp_directory_path.cc: New
test.
* testsuite/27_io/filesystem/operations/weakly_canonical.cc: New test.
* testsuite/27_io/filesystem/path/append/path.cc: New test.
* testsuite/27_io/filesystem/path/assign/assign.cc: New test.
* testsuite/27_io/filesystem/path/assign/copy.cc: New test.
* testsuite/27_io/filesystem/path/compare/compare.cc: New test.
* testsuite/27_io/filesystem/path/compare/path.cc: New test.
* testsuite/27_io/filesystem/path/compare/strings.cc: New test.
* testsuite/27_io/filesystem/path/concat/path.cc: New test.
* testsuite/27_io/filesystem/path/concat/strings.cc: New test.
* testsuite/27_io/filesystem/path/construct/copy.cc: New test.
* testsuite/27_io/filesystem/path/construct/default.cc: New test.
* testsuite/27_io/filesystem/path/construct/locale.cc: New test.
* testsuite/27_io/filesystem/path/construct/range.cc: New test.
* testsuite/27_io/filesystem/path/construct/string_view.cc: New test.
* testsuite/27_io/filesystem/path/decompose/extension.cc: New test.
* testsuite/27_io/filesystem/path/decompose/filename.cc: New test.
* testsuite/27_io/filesystem/path/decompose/parent_path.cc: New test.
* testsuite/27_io/filesystem/path/decompose/relative_path.cc: New
test.
* testsuite/27_io/filesystem/path/decompose/root_directory.cc: New
test.
* testsuite/27_io/filesystem/path/decompose/root_name.cc: New test.
* testsuite/27_io/filesystem/path/decompose/root_path.cc: New test.
* testsuite/27_io/filesystem/path/decompose/stem.cc: New test.
* testsuite/27_io/filesystem/path/generation/normal.cc: New test.
* testsuite/27_io/filesystem/path/generation/proximate.cc: New test.
* testsuite/27_io/filesystem/path/generation/relative.cc: New test.
* testsuite/27_io/filesystem/path/generic/generic_string.cc: New test.
* testsuite/27_io/filesystem/path/itr/traversal.cc: New test.
* testsuite/27_io/filesystem/path/modifiers/clear.cc: New test.
* testsuite/27_io/filesystem/path/modifiers/make_preferred.cc: New
test.
* testsuite/27_io/filesystem/path/modifiers/remove_filename.cc: New
test.
* testsuite/27_io/filesystem/path/modifiers/replace_extension.cc: New
test.
* testsuite/27_io/filesystem/path/modifiers/replace_filename.cc: New
test.
* testsuite/27_io/filesystem/path/modifiers/swap.cc: New test.
* testsuite/27_io/filesystem/path/native/string.cc: New test.
* testsuite/27_io/filesystem/path/nonmember/hash_value.cc: New test.
* testsuite/27_io/filesystem/path/query/empty.cc: New test.
* testsuite/27_io/filesystem/path/query/has_extension.cc: New test.
* testsuite/27_io/filesystem/path/query/has_filename.cc: New test.
* testsuite/27_io/filesystem/path/query/has_parent_path.cc: New test.
* testsuite/27_io/filesystem/path/query/has_relative_path.cc: New
test.
* testsuite/27_io/filesystem/path/query/has_root_directory.cc: New
test.
* testsuite/27_io/filesystem/path/query/has_root_name.cc: New test.
* testsuite/27_io/filesystem/path/query/has_root_path.cc: New test.
* testsuite/27_io/filesystem/path/query/has_stem.cc: New test.
* testsuite/27_io/filesystem/path/query/is_relative.cc: New test.
* testsuite/experimental/filesystem/path/construct/string_view.cc:
Define USE_FILESYSTEM_TS.
* testsuite/util/testsuite_fs.h: Allow use with C++17 paths as well
as Filesystem TS.
From-SVN: r254008
2017-10-23 13:11:22 +01:00
Jonathan Wakely
908d1d3aea
PR libstdc++/82644 document IS 29124 support
...
Also fix declarations of special functions in C++17, to import them into
the global namespace in <math.h>, and to prevent defining the
non-standard hypergeometric functions in strict mode.
PR libstdc++/82644
* doc/xml/manual/intro.xml: Include new section.
* doc/xml/manual/status_cxxis29124.xml: New section on IS 29124
status.
* include/bits/specfun.h [__STRICT_ANSI__] (hyperg, hypergf, hypergl)
(conf_hyperg, conf_hypergf, conf_hypergl): Don't declare.
* include/c_compatibility/math.h: Import special functions into
global namespace for C++17.
* testsuite/26_numerics/headers/cmath/82644.cc: New test.
* testsuite/26_numerics/headers/cmath/functions_global_c++17.cc: New
test.
From-SVN: r254004
2017-10-23 12:10:28 +01:00
Jonathan Wakely
dfdf2839b5
Fix invalid path::iterator test
...
* testsuite/experimental/filesystem/path/itr/traversal.cc: Do not
increment past-the-end iterators.
From-SVN: r253967
2017-10-21 02:16:43 +01:00
Jonathan Wakely
233fa165ad
Update value of __cpp_lib_chrono feature-test macro
...
* include/std/chrono (__cpp_lib_chrono): Update macro value to
indicate support for P0505R0.
* testsuite/20_util/duration/arithmetic/constexpr_c++17.cc: Check
for updated macro.
From-SVN: r253959
2017-10-20 22:05:11 +01:00
Jonathan Wakely
253e8d2150
Define __cpp_lib_byte feature-test macro
...
* include/c_global/cstddef: Define __cpp_lib_byte feature-test macro.
* testsuite/18_support/byte/requirements.cc: Check macro.
From-SVN: r253952
2017-10-20 19:02:19 +01:00
Jonathan Wakely
db62ad7c66
Improve tests for error reporting in Filesystem TS
...
* testsuite/experimental/filesystem/iterators/
recursive_directory_iterator.cc: Ensure that error_code arguments are
cleared when required.
* testsuite/experimental/filesystem/operations/create_directory.cc:
Remove redundant check.
* testsuite/experimental/filesystem/operations/temp_directory_path.cc:
Ensure that error_code argument is cleared when required.
From-SVN: r253897
2017-10-19 14:57:10 +01:00
Jonathan Wakely
551124d561
Fix path::iterator post-increment and post-decrement
...
* include/experimental/bits/fs_path.h (path::iterator++(int))
(path::iterator--(int)): Fix for paths with only one component.
* testsuite/experimental/filesystem/path/itr/traversal.cc: Test
post-increment and post-decrement.
From-SVN: r253896
2017-10-19 14:57:06 +01:00
Jonathan Wakely
89b1e16136
Update references to C++17 in libstdc++ manual
...
* doc/xml/manual/status_cxx2017.xml: Update references to C++17
section numbers.
From-SVN: r253895
2017-10-19 14:57:02 +01:00
Jonathan Wakely
af23b26ab0
Use __LONG_LONG_MAX__ instead of LONG_LONG_MAX in test
...
* testsuite/decimal/conversion-to-integral.cc: Use predefined macro
instead of non-standard glibc one.
From-SVN: r253894
2017-10-19 14:56:55 +01:00
François Dumont
1be043a140
re PR libstdc++/82558 (V8 JavaScript engine segfaults since r249235)
...
2017-10-16 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/82558
* include/bits/stl_bvector.h (fill): Add iterator offset check.
* testsuite/23_containers/vector/bool/82558.cc: New.
From-SVN: r253776
2017-10-16 05:44:03 +00:00
Jonathan Wakely
3b0dd4fea2
PR libstdc++/82522 overload map insert functions for rvalues (LWG 2354)
...
PR libstdc++/82522
* doc/xml/manual/intro.xml: Document LWG 2354 changes.
* include/bits/stl_map.h (map::insert(value_type&&))
(map::insert(const_iterator, value_type&&)): Add overload for rvalues.
* include/bits/stl_multimap.h (multimap::insert(value_type&&))
(multimap::insert(const_iterator, value_type&&)): Likewise.
* include/bits/unordered_map.h (unordered_map::insert(value_type&&))
(unordered_map::insert(const_iterator, value_type&&))
(unordered_multimap::insert(value_type&&))
(unordered_multimap::insert(const_iterator, value_type&&)): Likewise.
* testsuite/23_containers/map/modifiers/insert/dr2354.cc: New test.
* testsuite/23_containers/multimap/modifiers/insert/dr2354.cc: New
test.
* testsuite/23_containers/unordered_map/insert/dr2354.cc: New test.
* testsuite/23_containers/unordered_multimap/insert/dr2354.cc: New
test.
From-SVN: r253725
2017-10-13 13:39:32 +01:00
Jonathan Wakely
d1e85aa999
PR libstdc++/82481 Suppress clang-tidy warnings
...
PR libstdc++/82481
* include/std/mutex (call_once): Suppress clang-tidy warnings about
dangling references.
From-SVN: r253724
2017-10-13 13:39:24 +01:00
Jonathan Wakely
0e7300bb80
Update comment referring to status of LWG issue 111
...
* include/bits/streambuf_iterator.h (istreambuf_iterator::equal):
Update comment about NAD issue.
From-SVN: r253582
2017-10-10 12:26:10 +01:00
Jonathan Wakely
5d2b807526
PR libstdc++/82417 do not include C99 <complex.h> in strict modes
...
As an extension the C++ version of <complex.h> includes the C version,
but that defines macros with non-reserved names that should not be
defined in ISO C++. Only include the C header for non-strict modes, or
for pre-C++11 (because C++98 doesn't mention <complex.h> at all).
PR libstdc++/59087
PR libstdc++/82417
* include/c_compatibility/complex.h [!C++98 && __STRICT_ANSI__]: Do
not include C library's <complex.h>.
* testsuite/26_numerics/complex/c99.cc: Depend on __STRICT_ANSI__.
* testsuite/26_numerics/headers/complex.h/std_c++11.h: New test.
* testsuite/26_numerics/headers/complex.h/std_gnu++11.h: New test.
* testsuite/26_numerics/headers/complex.h/std_c++98.h: New test.
From-SVN: r253581
2017-10-10 12:25:45 +01:00
Jonathan Wakely
e58683fb9f
Fix new testsuite failure on newlib targets
...
* testsuite/20_util/to_chars/1.cc: Add dg-require-string-conversions.
From-SVN: r253463
2017-10-05 21:26:08 +01:00
Petr Ovtchenkov
4e91452412
2017-10-04 Petr Ovtchenkov <ptr@void-ptr.info>
...
François Dumont <fdumont@gcc.gnu.org>
* include/bits/streambuf_iterator.h
(istreambuf_iterator<>::operator*()): Do not capture iterator state
in Debug assertion.
(istreambuf_iterator<>::operator++()): Likewise and remove _M_sbuf check.
(istreambuf_iterator<>::operator++(int)): Likewise.
(istreambuf_iterator<>::_M_get()): Remove _M_c assignment.
(istreambuf_iterator<>::_S_is_eof()): New.
(istreambuf_iterator<>::_M_at_eof()): Adapt, use latter.
(find(istreambuf_iterator<>, istreambuf_iterator<>, _CharT)):
Return an iterator with _M_c set to eof to capture streambuf state
on evaluation.
(testsuite/24_iterators/istreambuf_iterator/2.cc): Add checks.
Co-Authored-By: François Dumont <fdumont@gcc.gnu.org>
From-SVN: r253417
2017-10-04 16:15:18 +00:00
Jakub Jelinek
9a741aee62
charconv (__unsigned_least_t): Fix number of closing >s for !_GLIBCXX_USE_INT128.
...
* include/std/charconv (__unsigned_least_t): Fix number of closing >s for
!_GLIBCXX_USE_INT128.
From-SVN: r253371
2017-10-03 01:28:54 +02:00
Jonathan Wakely
804b7cc438
C++17 P0067R5 std::to_chars and std::from_chars (partial)
...
This adds the integral overloads of std::to_chars and std::from_chars,
including the changes made by P0682R0. Support for floating point types
is absent.
* include/Makefile.am: Add new <charconv> header.
* include/Makefile.in: Regenerate.
* include/precompiled/stdc++.h: Include <charconv>.
* include/std/charconv: New file.
(to_chars_result, to_chars, from_chars_result, from_chars): Define.
* testsuite/20_util/from_chars/1.cc: New test.
* testsuite/20_util/from_chars/1_neg.cc: New test.
* testsuite/20_util/from_chars/2.cc: New test.
* testsuite/20_util/from_chars/requirements.cc: New test.
* testsuite/20_util/to_chars/1.cc: New test.
* testsuite/20_util/to_chars/1_neg.cc: New test.
* testsuite/20_util/to_chars/2.cc: New test.
* testsuite/20_util/to_chars/requirements.cc: New test.
From-SVN: r253353
2017-10-02 15:06:40 +01:00
François Dumont
c320262396
22131.cc: Make test less istreambuf_iterator implementation dependent.
...
2017-09-27 François Dumont <fdumont@gcc.gnu.org>
* testsuite/22_locale/money_get/get/char/22131.cc: Make test less
istreambuf_iterator implementation dependent.
* testsuite/22_locale/money_get/get/wchar_t/22131.cc: Likewise.
From-SVN: r253237
2017-09-27 20:16:43 +00:00
Uros Bizjak
75c44d2246
re PR c/81854 (weak alias of an incompatible symbol accepted)
...
PR c/81854
* src/c++98/complex_io.cc (_GLIBCXX_LDBL_COMPAT): Declare alias
target as a C++ function with no prototype.
From-SVN: r253153
2017-09-25 16:59:19 +02:00
Jonathan Wakely
f3f08c3f03
Fix tests for std::clamp
...
* testsuite/25_algorithms/clamp/1.cc: Fix order of arguments and
expected results when using predicate defining reverse order.
* testsuite/25_algorithms/clamp/constexpr.cc: Likewise.
From-SVN: r253051
2017-09-21 10:59:55 +01:00
Jonathan Wakely
9d2bac69bc
PR libstdc++/79162 Fix std::string regression due to LWG 2946 (old ABI)
...
PR libstdc++/79162
* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
(basic_string::_If_sv): Remove from the overload set when the
argument is derived from basic_string.
From-SVN: r253035
2017-09-20 23:03:37 +01:00