Ville Voutilainen
8bdbeed1d0
Protect optional's deduction guide with the feature macro
...
* include/std/optional: Use the feature macro.
From-SVN: r256185
2018-01-03 22:33:10 +02:00
Jakub Jelinek
85ec4feb11
Update copyright years.
...
From-SVN: r256169
2018-01-03 11:03:58 +01:00
Jonathan Wakely
ecba356686
PR libstdc++/83600 fix end iterator for unready std::match_results
...
PR libstdc++/83600
* include/bits/regex.h (match_results::end()): Return valid iterator
when not ready.
* testsuite/28_regex/match_results/ctors/char/default.cc: Check that
unready objects are empty and have equal begin and end iterators.
* testsuite/28_regex/match_results/ctors/wchar_t/default.cc: Likewise.
From-SVN: r256014
2017-12-27 22:18:08 +00:00
Jonathan Wakely
8afe2df012
PR libstdc++/83598 don't modify flags passed to std::basic_regex constructors
...
PR libstdc++/83598
* include/bits/regex.h (basic_regex): Don't modify flags passed to
constructors.
* testsuite/28_regex/basic_regex/ctors/83598.cc: New test.
From-SVN: r256013
2017-12-27 22:18:02 +00:00
Jonathan Wakely
c41743d0c0
PR libstdc++/83538 fix std::match_results<T>::reference (LWG 2306)
...
PR libstdc++/83538
* doc/xml/manual/intro.xml: Document LWG 2306 change.
* include/bits/regex.h (match_results::reference): Change to
non-const reference.
* testsuite/28_regex/match_results/typedefs.cc: Check types are
correct.
From-SVN: r256012
2017-12-27 19:43:33 +00:00
Michele Pezzutti
73986c315b
re PR libstdc++/83237 (Values returned by std::poisson_distribution are not distributed correctly)
...
2017-12-24 Michele Pezzutti <mpezz@tiscali.it>
PR libstdc++/83237
* include/bits/random.tcc (poisson_distribution<>::operator()):
Fix __x = 1 case - see updated Errata of Devroye's treatise.
* testsuite/26_numerics/random/poisson_distribution/operators/
values.cc: Add test.
* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error
line number.
From-SVN: r255993
2017-12-24 22:08:52 +00:00
Jonathan Wakely
4f9621392f
PR libstdc++/83450 avoid -Wreturn-type warning in test
...
PR libstdc++/83450
* testsuite/21_strings/basic_string/pthread18185.cc: Add return
statement.
From-SVN: r255992
2017-12-24 09:17:38 +00:00
François Dumont
1679da1571
re PR libstdc++/82522 (std::map::insert(value_type &&) not selected)
...
2017-12-20 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/82522
* include/debug/map.h (map::insert(value_type&&))
(map::insert(const_iterator, value_type&&)): Add overload for rvalues.
* include/debug/multimap.h (multimap::insert(value_type&&))
(multimap::insert(const_iterator, value_type&&)): Likewise.
* include/debug/unordered_map (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 (test02): New.
* testsuite/23_containers/multimap/modifiers/insert/dr2354.cc (test02):
New.
* testsuite/23_containers/unordered_map/insert/dr2354.cc (test02): New.
* testsuite/23_containers/unordered_multimap/insert/dr2354.cc (test02):
New.
From-SVN: r255904
2017-12-20 21:53:25 +00:00
Kyrylo Tkachov
0e0cefc62e
[aarch64][libstdc++] Use __ARM_BIG_ENDIAN instead of __AARCH64EB__ in opt_random.h
...
As has been spotted at https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01289.html
we check the __AARCH64EB__ macro for aarch64 big-endian
detection in config/cpu/aarch64/opt/ext/opt_random.h.
That works just fine with GCC but the standardised ACLE[1] macro
for that purpose is __ARM_BIG_ENDIAN so there is a possibility
that non-GCC compilers that include this header are not aware
of this predefine.
So this patch changes the use of __AARCH64EB__ to
the more portable __ARM_BIG_ENDIAN.
Tested on aarch64-none-elf and aarch64_be-none-elf.
Preapproved by Jeff at https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01326.html
* config/cpu/aarch64/opt/ext/opt_random.h (__VEXT): Check
__ARM_BIG_ENDIAN instead of __AARCH64EB__.
From-SVN: r255857
2017-12-20 10:28:13 +00:00
François Dumont
c0515cecee
Fix last ChangeLog entry date.
...
From-SVN: r255841
2017-12-19 21:24:30 +00:00
François Dumont
adaefe2a50
re PR libstdc++/80761 (std::set<T,C,A>::insert_return_type uses wrong iterator type)
...
2017-11-20 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/80761
* include/debug/map.h
(std::__debug::map<>::insert_return_type): Define using
_Node_insert_return.
* include/debug/set.h (std::__debug::set<>::insert_return_type):
Likewise.
* include/debug/unordered_map:
(std::__debug::unordered_map<>::insert_return_type): Likewise.
* include/debug/unordered_set:
(std::__debug::unordered_set<>::insert_return_type): Likewise.
From-SVN: r255789
2017-12-18 21:59:17 +00:00
Ville Voutilainen
5dd44f4ea5
re PR libstdc++/68430 (std::is_constructible<T>::value == true for unconstructible type T)
...
PR libstdc++/68430
* testsuite/20_util/is_constructible/68430.cc: New.
From-SVN: r255785
2017-12-18 20:46:30 +02:00
Martin Sebor
d43568222a
PR tree-optimization/83239 - False positive from -Wstringop-overflow
...
PR tree-optimization/83239 - False positive from -Wstringop-overflow
on simple std::vector code
libstdc++/CHangeLog:
* include/bits/vector.tcc (vector::_M_default_append): Assert
invariant to generate better code.
gcc/testsuite/ChangeLog:
* g++.dg/pr83239.C: New test case.
From-SVN: r255753
2017-12-16 15:37:22 -07:00
Jonathan Wakely
c49bef17fd
PR libstdc++/83279 handle sendfile not copying entire file
...
PR libstdc++/83279
* src/filesystem/std-ops.cc (do_copy_file): Handle sendfile not
copying entire file.
From-SVN: r255666
2017-12-14 21:49:03 +00:00
Jonathan Wakely
83fd5e73b3
PR libstdc++/68519 use native duration to avoid rounding errors
...
PR libstdc++/68519
* include/std/condition_variable (condition_variable::wait_for):
Convert duration to native clock's duration before addition.
* testsuite/30_threads/condition_variable/members/68519.cc: New test.
From-SVN: r255665
2017-12-14 20:41:52 +00:00
Jonathan Wakely
00677c4877
PR libstdc++/83427 detect weak result type from noexcept functions
...
PR libstdc++/83427
* include/bits/refwrap.h (_Maybe_unary_or_binary_function): Move here
from <bits/std_function.h>.
(_Mem_fn_traits_base, _Mem_fn_traits): Move here, from <functional>.
(_Weak_result_type_impl, _Reference_wrapper_base): Deduce noexcept
for function types. Remove partial specializations for member
functions.
(_Weak_result_type_impl): Remove unused partial specializations for
non-referenceable function types and for references to functions.
(_Weak_result_type_memfun, _Reference_wrapper_base_memfun): New
helpers to handle member functions via _Mem_fn_traits.
(_Weak_result_type, reference_wrapper): Derive from new helpers.
* include/bits/std_function.h (_Maybe_unary_or_binary_function): Move
to <bits/refwrap.h>.
* include/std/functional (_Pack, _AllConvertible, _NotSame): Remove.
(_Mem_fn_traits_base, _Mem_fn_traits): Move to <bits/refwrap.h>.
* testsuite/20_util/bind/83427.cc: New test.
* testsuite/20_util/bind/refqual.cc: Add noexcept to functions and
check for weak result types.
* testsuite/20_util/reference_wrapper/83427.cc: New test.
From-SVN: r255651
2017-12-14 17:18:22 +00:00
Jonathan Wakely
f297ebafdc
Test whitespace handling in std::complex extraction
...
* testsuite/26_numerics/complex/inserters_extractors/char/dr2714.cc:
Add tests using noskipws.
From-SVN: r255632
2017-12-14 11:47:42 +00:00
Jonathan Wakely
02aee32767
Improve std::complex test and move to sub-directory
...
* testsuite/26_numerics/complex/dr2714.cc: Move to ...
* testsuite/26_numerics/complex/inserters_extractors/char/dr2714.cc:
... Here. Remove duplicate header and dg-options. Check first invalid
character gets putback. Remove wchar_t test.
From-SVN: r255630
2017-12-14 11:28:41 +00:00
Jonathan Wakely
3ca652c199
PR libstdc++/59568 fix error handling for std::complex stream extraction
...
PR libstdc++/59568
* include/std/complex (operator>>): Implement proposed resolution to
LWG 2714. Use putback if and only if a character has been successfully
extracted but isn't a delimiter. Use ctype::widen and traits::eq when
testing if extracted characters match delimiters.
* testsuite/26_numerics/complex/dr2714.cc: New test.
From-SVN: r255608
2017-12-13 17:02:14 +00:00
Jonathan Wakely
91d01b33e8
PR libstdc++/83395 fix invocable traits for INVOKE<cv void>
...
PR libstdc++/83395
* include/std/type_traits (__is_invocable_impl): Remove partial
specialization for INVOKE<void> and restore is_void<R> check in
primary template.
(__is_nt_invocable_impl): Likewise.
* testsuite/20_util/is_invocable/83395.cc: New test.
* testsuite/20_util/is_nothrow_invocable/83395.cc: New test.
From-SVN: r255584
2017-12-12 17:42:19 +00:00
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
Jonathan Wakely
4cf5930fdc
PR libstdc++/79162 Fix std::string regression due to LWG 2946
...
PR libstdc++/79162
* include/bits/basic_string.h (basic_string::_If_sv): Remove from the
overload set when the argument is derived from basic_string.
* testsuite/21_strings/basic_string/cons/char/moveable2_c++17.cc: New
test.
* testsuite/21_strings/basic_string/cons/wchar_t/moveable2_c++17.cc:
New test.
From-SVN: r253024
2017-09-20 18:59:50 +01:00
Jonathan Wakely
e18f68c715
Fix failing C++17 test
...
* testsuite/24_iterators/range_access_cpp17.cc: Fix order of dg-do
and dg-options directives. Fix invalid test.
From-SVN: r253019
2017-09-20 17:34:53 +01:00
Jonathan Wakely
95ed529d34
PR libstdc++/81469 deprecate std::uncaught_exception for C++17
...
PR libstdc++/81469
* libsupc++/exception (uncaught_exception): Deprecate for C++17.
* testsuite/18_support/exception_ptr/62258.cc: Add -Wno-deprecated.
* testsuite/18_support/uncaught_exception/14026.cc: Likewise.
From-SVN: r253018
2017-09-20 17:34:49 +01:00
Jonathan Wakely
f78958c9b4
Deprecate nested types in std::hash
...
* include/bits/c++config (_GLIBCXX17_DEPRECATED): Define.
* include/bits/functional_hash.h (__hash_base::result_type)
(__hash_base::argument_type): Add _GLIBCXX17_DEPRECATED.
* include/std/optional (hash<optional<T>>::result_type)
(hash<optional<T>>::argument_type): Add deprecated attribute.
(__is_fast_hash<hash<optional<T>>>): Add partial specialization.
* include/std/variant (hash<variant<Types...>>::result_type)
(hash<variant<Types...>>::argument_type): Add deprecated attribute.
(__is_fast_hash<hash<variant<Types...>>>): Add partial specialization.
From-SVN: r253017
2017-09-20 17:34:42 +01:00
Jonathan Wakely
20f661fbd2
Remove non-standard std::copy_exception function
...
* libsupc++/exception_ptr.h (copy_exception): Remove deprecated
non-standard function.
From-SVN: r253011
2017-09-20 14:25:07 +01:00
Jonathan Wakely
f6b05c44aa
PR libstdc++/82262 fix std::hash<std::optional<const T>>
...
PR libstdc++/82262
* include/std/optional (__optional_hash_call_base): Add template
parameter for remove_const_t<_Tp> and use it consistently.
* testsuite/20_util/optional/hash.cc: Test optional<const T>.
From-SVN: r253010
2017-09-20 14:24:45 +01:00
Jonathan Wakely
23b49089a4
PR libstdc++/71500 restore C++11 compatibility in <regex>
...
PR libstdc++/71500
* include/bits/regex_executor.tcc
(_Backref_matcher<BidIt, regex_traits<C>>::_M_apply): Use
std::__equal4 instead of C++14 4-iterator overloads of std::equal.
* include/bits/stl_algobase.h (__equal4): New functions implementing
4-iterator overloads of std::equal for use in C++11.
(equal(It1, It1, It2, It2), equal(It1, It1, It2, It2, BinaryPred)):
Move function bodies to new __equal4 functions.
* testsuite/28_regex/simple_c++11.cc: New.
From-SVN: r252981
2017-09-19 18:06:12 +01:00
Jonathan Wakely
c4b06e7f1d
PR libstdc++/82254 fix std::is_nothrow_invocable_r w.r.t throwing conversions
...
PR libstdc++/82254
* include/std/type_traits (__is_invocable): Add partial specialization
for INVOKE<void> case and remove is_void<R> check from partial
specialization for INVOKE<R> case.
(__is_nt_invocable_impl): New helper for is_nothrow_invocable_r.
(is_nothrow_invocable_r): Use __is_nt_invocable_impl.
* testsuite/20_util/is_nothrow_invocable/value.cc: Add tests for
conversions that can throw or fail to convert. Use static assert
strings to explain negative results.
* testsuite/20_util/is_nothrow_invocable/value_ext.cc: Use
is_nothrow_constructible in is_nt_invocable_conv.
From-SVN: r252977
2017-09-19 15:33:51 +01:00
Jonathan Wakely
e1227692dd
PR libstdc++/81468 fix test for duration conversions
...
PR libstdc++/81468
* testsuite/20_util/duration/cons/dr1177.cc: Fix incorrect test and
improve static assertion messages.
From-SVN: r252950
2017-09-18 21:00:32 +01:00
Jonathan Wakely
db624b3b4b
Use built-in for std::make_integer_sequnce
...
* include/std/utility (_Itup_cat, _Make_integer_sequence): Remove.
(_Build_index_tuple, make_integer_sequence): Use built-in to generate
pack expansion.
From-SVN: r252923
2017-09-18 13:02:19 +01:00
Jonathan Wakely
ec26ff5a01
PR libstdc++/71187 reimplement declval without add_rvalue_reference
...
PR libstdc++/71187
* include/std/type_traits (__declval): New function to deduce return
type of declval.
(__declval_protector::_delegate): Remove.
(declval): Use __declval instead of add_rvalue_reference and
__declval_protector::__delegate.
* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error
lineno.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
Likewise.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
Likewise.
From-SVN: r252922
2017-09-18 12:40:10 +01:00
Jakub Jelinek
7b9361409d
invoke.texi: Document -std=c++17 and -std=gnu++17 and document c++1z and gnu++1z as deprecated.
...
* doc/invoke.texi: Document -std=c++17 and -std=gnu++17 and document
c++1z and gnu++1z as deprecated. Change other references to
-std=c++1z to -std=c++17 and -std=gnu++1z to -std=gnu++17.
Change -Wc++1z-compat to -Wc++17-compat.
* doc/cpp.texi: Document -std=c++17 defines __cplusplus 201703L.
* dwarf2out.c (highest_c_language): Handle C++17.
(gen_compile_unit_die): Likewise.
c-family/
* c.opt (Wc++1z-compat): Change from option to undocumented alias.
(Wc++17-compat): Change from undocumented alias to option.
(Wnoexcept-type): Enable by Wc++17-compat instead of Wc++1z-compat,
change C++1z to C++17 in description.
(std=c++1z, std=gnu++1z): Change from option to undocumented
deprecated alias.
(std=c++17, std=gnu++17): Change from undocumented alias to option.
Adjust description.
* c-common.h (enum cxx_dialect): Rename cxx1z to cxx17.
* c-opts.c (set_std_cxx1z): Rename to ...
(set_std_cxx17): ... this.
(c_common_handle_option): Rename OPT_std_c__1z to OPT_std_c__17
and OPT_std_gnu__1z to OPT_std_gnu__17. Adjust set_std_cxx1z
caller.
(c_common_post_options): Use cxx17 instead of cxx1z. Adjust
comments.
cp/
* decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
to C++17 or -std=gnu++17 or -std=c++17. Adjust comments.
(cxx_init_decl_processing, next_initializable_field,
is_direct_enum_init, check_initializer, cp_finish_decl,
mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
finish_function): Likewise.
* cp-tree.h (DECL_INLINE_VAR_P): Likewise.
* pt.c (mark_template_parm, convert_nontype_argument,
instantiate_class_template_1, type_unification_real, unify,
get_partial_spec_bindings, dependent_type_p_r): Likewise.
* typeck.c (cp_build_unary_op): Likewise.
* constexpr.c (var_in_maybe_constexpr_fn): Likewise.
* call.c (build_user_type_conversion_1, build_over_call,
build_special_member_call): Likewise.
* lambda.c (begin_lambda_type): Likewise.
* typeck2.c (process_init_constructor_record): Likewise.
* class.c (build_base_field, finalize_literal_type_property,
explain_non_literal_class): Likewise.
* parser.c (cp_parser_diagnose_invalid_type_name,
cp_parser_primary_expression, cp_parser_lambda_introducer,
cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
cp_convert_range_for, cp_parser_perform_range_for_lookup,
cp_parser_decomposition_declaration, cp_parser_linkage_specification,
cp_parser_static_assert, cp_parser_simple_type_specifier,
cp_parser_namespace_definition, cp_parser_using_declaration,
cp_parser_init_declarator, cp_parser_type_parameter_key,
cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
cp_parser_constructor_declarator_p): Likewise.
* mangle.c (struct globals): Rename need_cxx1z_warning to
need_cxx17_warning.
(write_exception_spec, start_mangling, mangle_decl): Likewise.
* Make-lang.in (check-c++1z): Rename to check-c++17, depend on
it.
(check-c++17): New goal. Use 17 instead of 1z.
(check-c++-all): Use 17 instead of 1z.
testsuite/
* lib/g++-dg.exp (g++-dg-runtest): Use 17 instead of 1z.
* lib/target-supports.exp (check_effective_target_c++14): Use
check_effective_target_c++17 instead of check_effective_target_c++1z.
(check_effective_target_c++14_down): Likewise.
(check_effective_target_c++1z_only): Rename to ...
(check_effective_target_c++17_only): ... this.
(check_effective_target_c++1z): Rename to ...
(check_effective_target_c++17): ... this.
* g++.dg/debug/dwarf2/inline-var-1.C: Use -std=c++17 or -std=gnu++17
instead of -std=c++1z or -std=gnu++1z. Use c++17 instead of c++1z
and c++17_only instead of c++1z_only. Adjust expected diagnostics
and comments refering to 1z to 17.
* g++.dg/debug/dwarf2/inline-var-2.C: Likewise.
* g++.dg/template/partial5.C: Likewise.
* g++.dg/template/nontype8.C: Likewise.
* g++.dg/cpp1z/noexcept-type5.C: Likewise.
* g++.dg/cpp1z/nontype3a.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda4.C: Likewise.
* g++.dg/cpp1z/noexcept-type16.C: Likewise.
* g++.dg/cpp1z/class-deduction32.C: Likewise.
* g++.dg/cpp1z/pr78771.C: Likewise.
* g++.dg/cpp1z/elide1.C: Likewise.
* g++.dg/cpp1z/fold3.C: Likewise.
* g++.dg/cpp1z/class-deduction2.C: Likewise.
* g++.dg/cpp1z/noexcept-type12.C: Likewise.
* g++.dg/cpp1z/inline-var2.C: Likewise.
* g++.dg/cpp1z/eval-order2.C: Likewise.
* g++.dg/cpp1z/decomp21.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda11.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda9.C: Likewise.
* g++.dg/cpp1z/utf8-neg.C: Likewise.
* g++.dg/cpp1z/class-deduction41.C: Likewise.
* g++.dg/cpp1z/class-deduction23.C: Likewise.
* g++.dg/cpp1z/nodiscard3.C: Likewise.
* g++.dg/cpp1z/static_assert-nomsg.C: Likewise.
* g++.dg/cpp1z/noexcept-type9.C: Likewise.
* g++.dg/cpp1z/class-deduction21.C: Likewise.
* g++.dg/cpp1z/range-for1.C: Likewise.
* g++.dg/cpp1z/init-statement4.C: Likewise.
* g++.dg/cpp1z/udlit-utf8char.C: Likewise.
* g++.dg/cpp1z/decomp30.C: Likewise.
* g++.dg/cpp1z/class-deduction39.C: Likewise.
* g++.dg/cpp1z/register2.C: Likewise.
* g++.dg/cpp1z/decomp9.C: Likewise.
* g++.dg/cpp1z/regress1.C: Likewise.
* g++.dg/cpp1z/direct-enum-init1.C: Likewise.
* g++.dg/cpp1z/class-deduction30.C: Likewise.
* g++.dg/cpp1z/abbrev2.C: Likewise.
* g++.dg/cpp1z/nontype-auto6.C: Likewise.
* g++.dg/cpp1z/regress2.C: Likewise.
* g++.dg/cpp1z/decomp16.C: Likewise.
* g++.dg/cpp1z/bool-increment1.C: Likewise.
* g++.dg/cpp1z/aligned-new1.C: Likewise.
* g++.dg/cpp1z/decomp3.C: Likewise.
* g++.dg/cpp1z/register1.C: Likewise.
* g++.dg/cpp1z/namespace-attribs.C: Likewise.
* g++.dg/cpp1z/class-deduction1.C: Likewise.
* g++.dg/cpp1z/decomp10.C: Likewise.
* g++.dg/cpp1z/constexpr-if11.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda10.C: Likewise.
* g++.dg/cpp1z/decomp27.C: Likewise.
* g++.dg/cpp1z/noexcept-type2.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda6.C: Likewise.
* g++.dg/cpp1z/class-deduction9.C: Likewise.
* g++.dg/cpp1z/attributes-enum-1.C: Likewise.
* g++.dg/cpp1z/decomp11.C: Likewise.
* g++.dg/cpp1z/aligned-new3.C: Likewise.
* g++.dg/cpp1z/utf8-2.C: Likewise.
* g++.dg/cpp1z/lambda-this3.C: Likewise.
* g++.dg/cpp1z/decomp-constexpr1.C: Likewise.
* g++.dg/cpp1z/byte1.C: Likewise.
* g++.dg/cpp1z/nontype-auto9.C: Likewise.
* g++.dg/cpp1z/aggr-base4.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda1.C: Likewise.
* g++.dg/cpp1z/nontype-auto3.C: Likewise.
* g++.dg/cpp1z/utf8-2a.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda7.C: Likewise.
* g++.dg/cpp1z/aggr-base6.C: Likewise.
* g++.dg/cpp1z/cplusplus.C: Likewise.
* g++.dg/cpp1z/class-deduction20.C: Likewise.
* g++.dg/cpp1z/aggr-base2.C: Likewise.
* g++.dg/cpp1z/class-deduction6.C: Likewise.
* g++.dg/cpp1z/noexcept-type3.C: Likewise.
* g++.dg/cpp1z/class-deduction31.C: Likewise.
* g++.dg/cpp1z/class-deduction25.C: Likewise.
* g++.dg/cpp1z/class-deduction18.C: Likewise.
* g++.dg/cpp1z/fold9.C: Likewise.
* g++.dg/cpp1z/noexcept-type8.C: Likewise.
* g++.dg/cpp1z/abbrev1.C: Likewise.
* g++.dg/cpp1z/constexpr-if10.C: Likewise.
* g++.dg/cpp1z/utf8.C: Likewise.
* g++.dg/cpp1z/noexcept-type7.C: Likewise.
* g++.dg/cpp1z/aggr-base3.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda8.C: Likewise.
* g++.dg/cpp1z/init-statement2.C: Likewise.
* g++.dg/cpp1z/nontype-auto4.C: Likewise.
* g++.dg/cpp1z/constexpr-if12.C: Likewise.
* g++.dg/cpp1z/class-deduction40.C: Likewise.
* g++.dg/cpp1z/nontype3.C: Likewise.
* g++.dg/cpp1z/class-deduction14.C: Likewise.
* g++.dg/cpp1z/fold7.C: Likewise.
* g++.dg/cpp1z/nontype2.C: Likewise.
* g++.dg/cpp1z/class-deduction15.C: Likewise.
* g++.dg/cpp1z/nested-namespace-def1.C: Likewise.
* g++.dg/cpp1z/class-deduction13.C: Likewise.
* g++.dg/cpp1z/aligned-new7.C: Likewise.
* g++.dg/cpp1z/noexcept-type1.C: Likewise.
* g++.dg/cpp1z/nontype1.C: Likewise.
* g++.dg/cpp1z/init-statement5.C: Likewise.
* g++.dg/cpp1z/nontype-auto2.C: Likewise.
* g++.dg/cpp1z/decomp17.C: Likewise.
* g++.dg/cpp1z/fold4.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda2.C: Likewise.
* g++.dg/cpp1z/fold7a.C: Likewise.
* g++.dg/cpp1z/nontype-auto5.C: Likewise.
* g++.dg/cpp1z/init-statement7.C: Likewise.
* g++.dg/cpp1z/aggr-base5.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda5.C: Likewise.
* g++.dg/cpp1z/pr79143.C: Likewise.
* g++.dg/cpp1z/class-deduction38.C: Likewise.
* g++.dg/cpp1z/nontype-auto8.C: Likewise.
* g++.dg/cpp1z/class-deduction12.C: Likewise.
* g++.dg/cpp1z/decomp20.C: Likewise.
* g++.dg/cpp1z/class-deduction22.C: Likewise.
* g++.dg/cpp1z/class-deduction29.C: Likewise.
* g++.dg/cpp1z/class-deduction8.C: Likewise.
* g++.dg/cpp1z/class-deduction43.C: Likewise.
* g++.dg/cpp1z/feat-cxx1z.C: Likewise.
* g++.dg/cpp1z/fold8.C: Likewise.
* g++.dg/cpp1z/init-statement3.C: Likewise.
* g++.dg/cpp1z/nontype-auto10.C: Likewise.
* g++.dg/cpp1z/class-deduction36.C: Likewise.
* g++.dg/cpp1z/noexcept-type17.C: Likewise.
* g++.dg/cpp1z/fallthrough1.C: Likewise.
* g++.dg/cpp1z/fold1.C: Likewise.
* g++.dg/cpp1z/class-deduction26.C: Likewise.
* g++.dg/cpp1z/fold-ice1.C: Likewise.
* g++.dg/cpp1z/fold5.C: Likewise.
* g++.dg/cpp1z/class-deduction34.C: Likewise.
* g++.dg/cpp1z/noexcept-type6.C: Likewise.
* g++.dg/cpp1z/class-deduction7.C: Likewise.
* g++.dg/cpp1z/class-deduction16.C: Likewise.
* g++.dg/cpp1z/class-deduction10.C: Likewise.
* g++.dg/cpp1z/eval-order3.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda13.C: Likewise.
* g++.dg/cpp1z/aggr-base2a.C: Likewise.
* g++.dg/cpp1z/nontype-auto1.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda3.C: Likewise.
* g++.dg/cpp1z/nontype-auto7.C: Likewise.
* g++.dg/cpp1z/decomp15.C: Likewise.
* g++.dg/cpp1z/noexcept-type4.C: Likewise.
* g++.dg/cpp1z/fold-mangle.C: Likewise.
* g++.dg/cpp1z/class-deduction35.C: Likewise.
* g++.dg/cpp1z/decomp4.C: Likewise.
* g++.dg/cpp1z/class-deduction42.C: Likewise.
* g++.dg/cpp1z/init-statement8.C: Likewise.
* g++.dg/cpp1z/inline-var1a.C: Likewise.
* g++.dg/cpp1z/init-statement6.C: Likewise.
* g++.dg/cpp1z/class-deduction17.C: Likewise.
* g++.dg/cpp1z/class-deduction28.C: Likewise.
* g++.dg/cpp1z/class-deduction27.C: Likewise.
* g++.dg/cpp1z/decomp-bitfield1.C: Likewise.
* g++.dg/cpp1z/attributes-enum-1a.C: Likewise.
* g++.dg/cpp1z/class-deduction11.C: Likewise.
* g++.dg/cpp1z/constexpr-lambda12.C: Likewise.
* g++.dg/cpp1z/init-statement9.C: Likewise.
* g++.dg/cpp1z/class-deduction19.C: Likewise.
* g++.dg/cpp1z/class-deduction5.C: Likewise.
* g++.dg/cpp1z/fold2.C: Likewise.
* g++.dg/cpp1z/class-deduction33.C: Likewise.
* g++.dg/cpp1z/class-deduction24.C: Likewise.
* g++.dg/cpp1z/aggr-base1.C: Likewise.
* g++.dg/cpp1z/fold6.C: Likewise.
* g++.dg/cpp1z/decomp12.C: Likewise.
* g++.dg/cpp1z/class-deduction4.C: Likewise.
* g++.dg/cpp1z/inline-var1.C: Likewise.
* g++.dg/cpp1z/aligned-new2.C: Likewise.
* g++.dg/cpp1z/class-deduction3.C: Likewise.
* g++.dg/other/error3.C: Likewise.
* g++.dg/init/new25.C: Likewise.
* g++.dg/init/new13.C: Likewise.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/tls/diag-4.C: Likewise.
* g++.dg/opt/noreturn-1.C: Likewise.
* g++.dg/eh/async-unwind2.C: Likewise.
* g++.dg/eh/spec9.C: Likewise.
* g++.dg/eh/spec7.C: Likewise.
* g++.dg/eh/template1.C: Likewise.
* g++.dg/eh/cond4.C: Likewise.
* g++.dg/eh/pr41819.C: Likewise.
* g++.dg/eh/delete1.C: Likewise.
* g++.dg/eh/spec3.C: Likewise.
* g++.dg/eh/forced4.C: Likewise.
* g++.dg/eh/spec2.C: Likewise.
* g++.dg/eh/shadow1.C: Likewise.
* g++.dg/eh/pr38662.C: Likewise.
* g++.dg/eh/ehopt1.C: Likewise.
* g++.dg/eh/spec8.C: Likewise.
* g++.dg/eh/init-temp2.C: Likewise.
* g++.dg/rtti/crash3.C: Likewise.
* g++.dg/warn/Wreturn-type-3.C: Likewise.
* g++.dg/warn/register-parm-1.C: Likewise.
* g++.dg/warn/register-var-2.C: Likewise.
* g++.dg/gcov/gcov-7.C: Likewise.
* g++.dg/tree-ssa/pr45605.C: Likewise.
* g++.dg/cpp/pr23827_cxx98_neg.C: Likewise.
* g++.dg/lookup/exception1.C: Likewise.
* g++.dg/ubsan/pr79589.C: Likewise.
* g++.dg/tm/pr47340.C: Likewise.
* g++.dg/tm/pr46567.C: Likewise.
* g++.dg/expr/bitfield5.C: Likewise.
* g++.dg/expr/bool1.C: Likewise.
* g++.dg/expr/lval3.C: Likewise.
* g++.dg/expr/lval4.C: Likewise.
* g++.dg/expr/bitfield4.C: Likewise.
* g++.dg/expr/bitfield6.C: Likewise.
* g++.dg/expr/bool3.C: Likewise.
* g++.dg/ext/has_nothrow_constructor.C: Likewise.
* g++.dg/ext/has_nothrow_copy-7.C: Likewise.
* g++.dg/ext/has_nothrow_copy-1.C: Likewise.
* g++.dg/ext/has_nothrow_copy-2.C: Likewise.
* g++.dg/ext/has_nothrow_copy-4.C: Likewise.
* g++.dg/ext/has_nothrow_copy-5.C: Likewise.
* g++.dg/ext/has_nothrow_copy-6.C: Likewise.
* g++.dg/ext/has_nothrow_assign.C: Likewise.
* g++.dg/parse/register1.C: Likewise.
* g++.dg/parse/error15.C: Likewise.
* g++.dg/parse/linkage2.C: Likewise.
* g++.dg/concepts/intro2.C: Likewise.
* g++.dg/concepts/class.C: Likewise.
* g++.dg/concepts/traits1.C: Likewise.
* g++.dg/concepts/req5.C: Likewise.
* g++.dg/concepts/var-concept5.C: Likewise.
* g++.dg/concepts/fn-concept2.C: Likewise.
* g++.dg/concepts/traits2.C: Likewise.
* g++.dg/concepts/placeholder2.C: Likewise.
* g++.dg/concepts/class6.C: Likewise.
* g++.dg/concepts/memtmpl1.C: Likewise.
* g++.dg/concepts/friend2.C: Likewise.
* g++.dg/concepts/template-parm3.C: Likewise.
* g++.dg/concepts/template-parm10.C: Likewise.
* g++.dg/concepts/explicit-spec1.C: Likewise.
* g++.dg/concepts/explicit-spec3.C: Likewise.
* g++.dg/concepts/var-templ2.C: Likewise.
* g++.dg/concepts/intro5.C: Likewise.
* g++.dg/concepts/deduction-constraint1.C: Likewise.
* g++.dg/concepts/iconv1.C: Likewise.
* g++.dg/concepts/constrained-parm.C: Likewise.
* g++.dg/concepts/template-template-parm1.C: Likewise.
* g++.dg/concepts/var-concept3.C: Likewise.
* g++.dg/concepts/class3.C: Likewise.
* g++.dg/concepts/memfun2.C: Likewise.
* g++.dg/concepts/req1.C: Likewise.
* g++.dg/concepts/disjunction1.C: Likewise.
* g++.dg/concepts/req17.C: Likewise.
* g++.dg/concepts/pr65848.C: Likewise.
* g++.dg/concepts/placeholder4.C: Likewise.
* g++.dg/concepts/decl-diagnose.C: Likewise.
* g++.dg/concepts/intro7.C: Likewise.
* g++.dg/concepts/pr68683.C: Likewise.
* g++.dg/concepts/partial-spec4.C: Likewise.
* g++.dg/concepts/template-parm5.C: Likewise.
* g++.dg/concepts/explicit-inst1.C: Likewise.
* g++.dg/concepts/class-deduction1.C: Likewise.
* g++.dg/concepts/class1.C: Likewise.
* g++.dg/concepts/req15.C: Likewise.
* g++.dg/concepts/memfun.C: Likewise.
* g++.dg/concepts/pr68434.C: Likewise.
* g++.dg/concepts/inherit-ctor4.C: Likewise.
* g++.dg/concepts/partial-spec6.C: Likewise.
* g++.dg/concepts/var-templ1.C: Likewise.
* g++.dg/concepts/template-parm8.C: Likewise.
* g++.dg/concepts/explicit-inst3.C: Likewise.
* g++.dg/concepts/class4.C: Likewise.
* g++.dg/concepts/req6.C: Likewise.
* g++.dg/concepts/fn8.C: Likewise.
* g++.dg/concepts/class5.C: Likewise.
* g++.dg/concepts/placeholder5.C: Likewise.
* g++.dg/concepts/req16.C: Likewise.
* g++.dg/concepts/req10.C: Likewise.
* g++.dg/concepts/var-concept2.C: Likewise.
* g++.dg/concepts/auto3.C: Likewise.
* g++.dg/concepts/generic-fn-err.C: Likewise.
* g++.dg/concepts/pr65552.C: Likewise.
* g++.dg/concepts/partial-concept-id2.C: Likewise.
* g++.dg/concepts/fn1.C: Likewise.
* g++.dg/concepts/partial-spec.C: Likewise.
* g++.dg/concepts/template-parm12.C: Likewise.
* g++.dg/concepts/diagnostic1.C: Likewise.
* g++.dg/concepts/intro1.C: Likewise.
* g++.dg/concepts/explicit-inst4.C: Likewise.
* g++.dg/concepts/req18.C: Likewise.
* g++.dg/concepts/explicit-spec5.C: Likewise.
* g++.dg/concepts/var-concept6.C: Likewise.
* g++.dg/concepts/fn9.C: Likewise.
* g++.dg/concepts/req2.C: Likewise.
* g++.dg/concepts/template-parm7.C: Likewise.
* g++.dg/concepts/req14.C: Likewise.
* g++.dg/concepts/template-parm6.C: Likewise.
* g++.dg/concepts/variadic4.C: Likewise.
* g++.dg/concepts/fn6.C: Likewise.
* g++.dg/concepts/req-neg1.C: Likewise.
* g++.dg/concepts/alias3.C: Likewise.
* g++.dg/concepts/expression2.C: Likewise.
* g++.dg/concepts/partial-spec3.C: Likewise.
* g++.dg/concepts/expression3.C: Likewise.
* g++.dg/concepts/memfun-err.C: Likewise.
* g++.dg/concepts/pr66091.C: Likewise.
* g++.dg/concepts/explicit-spec2.C: Likewise.
* g++.dg/concepts/equiv.C: Likewise.
* g++.dg/concepts/friend1.C: Likewise.
* g++.dg/concepts/fn4.C: Likewise.
* g++.dg/concepts/var-templ3.C: Likewise.
* g++.dg/concepts/explicit-inst2.C: Likewise.
* g++.dg/concepts/alias2.C: Likewise.
* g++.dg/concepts/regress/alias-decl-42.C: Likewise.
* g++.dg/concepts/placeholder6.C: Likewise.
* g++.dg/concepts/fn10.C: Likewise.
* g++.dg/concepts/req3.C: Likewise.
* g++.dg/concepts/variadic2.C: Likewise.
* g++.dg/concepts/pr65636.C: Likewise.
* g++.dg/concepts/intro6.C: Likewise.
* g++.dg/concepts/class2.C: Likewise.
* g++.dg/concepts/fn2.C: Likewise.
* g++.dg/concepts/req20.C: Likewise.
* g++.dg/concepts/req8.C: Likewise.
* g++.dg/concepts/placeholder1.C: Likewise.
* g++.dg/concepts/pr65854.C: Likewise.
* g++.dg/concepts/member-concept.C: Likewise.
* g++.dg/concepts/template-parm2.C: Likewise.
* g++.dg/concepts/variadic1.C: Likewise.
* g++.dg/concepts/fn7.C: Likewise.
* g++.dg/concepts/intro4.C: Likewise.
* g++.dg/concepts/req13.C: Likewise.
* g++.dg/concepts/inherit-ctor3.C: Likewise.
* g++.dg/concepts/explicit-spec6.C: Likewise.
* g++.dg/concepts/auto1.C: Likewise.
* g++.dg/concepts/alias1.C: Likewise.
* g++.dg/concepts/fn-concept1.C: Likewise.
* g++.dg/concepts/template-parm11.C: Likewise.
* g++.dg/concepts/explicit-spec4.C: Likewise.
* g++.dg/concepts/partial-concept-id1.C: Likewise.
* g++.dg/concepts/req9.C: Likewise.
* g++.dg/concepts/req4.C: Likewise.
* g++.dg/concepts/pr65681.C: Likewise.
* g++.dg/concepts/req7.C: Likewise.
* g++.dg/concepts/req12.C: Likewise.
* g++.dg/concepts/fn5.C: Likewise.
* g++.dg/concepts/alias4.C: Likewise.
* g++.dg/concepts/generic-fn.C: Likewise.
* g++.dg/concepts/feature-macro.C: Likewise.
* g++.dg/concepts/req19.C: Likewise.
* g++.dg/concepts/placeholder3.C: Likewise.
* g++.dg/concepts/intro3.C: Likewise.
* g++.dg/concepts/partial-spec5.C: Likewise.
* g++.dg/concepts/template-parm4.C: Likewise.
* g++.dg/concepts/dr1430.C: Likewise.
* g++.dg/concepts/pr65634.C: Likewise.
* g++.dg/concepts/var-concept4.C: Likewise.
* g++.dg/concepts/pr67249.C: Likewise.
* g++.dg/concepts/expression.C: Likewise.
* g++.dg/concepts/pr65575.C: Likewise.
* g++.dg/concepts/partial-spec2.C: Likewise.
* g++.dg/concepts/template-parm9.C: Likewise.
* g++.dg/concepts/inherit-ctor1.C: Likewise.
* g++.dg/concepts/equiv2.C: Likewise.
* g++.dg/concepts/req11.C: Likewise.
* g++.dg/concepts/template-parm1.C: Likewise.
* g++.dg/concepts/inherit-ctor2.C: Likewise.
* g++.dg/concepts/var-concept1.C: Likewise.
* g++.dg/concepts/fn3.C: Likewise.
* g++.dg/torture/pr46364.C: Likewise.
* g++.dg/torture/stackalign/eh-alloca-1.C: Likewise.
* g++.dg/torture/stackalign/eh-fastcall-1.C: Likewise.
* g++.dg/torture/stackalign/eh-vararg-1.C: Likewise.
* g++.dg/torture/stackalign/eh-vararg-2.C: Likewise.
* g++.dg/torture/stackalign/eh-global-1.C: Likewise.
* g++.dg/torture/stackalign/eh-thiscall-1.C: Likewise.
* g++.dg/torture/stackalign/eh-inline-2.C: Likewise.
* g++.dg/torture/stackalign/eh-inline-1.C: Likewise.
* g++.dg/torture/pr52918-1.C: Likewise.
* g++.dg/torture/pr49394.C: Likewise.
* g++.dg/torture/pr57190.C: Likewise.
* g++.dg/cpp0x/static_assert8.C: Likewise.
* g++.dg/cpp0x/noexcept19.C: Likewise.
* g++.dg/cpp0x/variadic-throw.C: Likewise.
* g++.dg/cpp0x/variadic73.C: Likewise.
* g++.dg/cpp0x/noexcept02.C: Likewise.
* g++.dg/cpp0x/defaulted23.C: Likewise.
* g++.dg/cpp0x/noexcept08.C: Likewise.
* g++.dg/cpp0x/auto9.C: Likewise.
* g++.dg/cpp0x/lambda/lambda-eh2.C: Likewise.
* g++.dg/cpp0x/error5.C: Likewise.
* c-c++-common/gomp/atomic-12.c: Likewise.
* c-c++-common/gomp/atomic-13.c: Likewise.
* c-c++-common/gomp/atomic-14.c: Likewise.
* c-c++-common/Wvarargs-2.c: Likewise.
* c-c++-common/Wvarargs.c: Likewise.
* c-c++-common/vector-subscript-2.c: Likewise.
* g++.old-deja/g++.robertl/eb123.C: Likewise.
* g++.old-deja/g++.eh/tmpl3.C: Likewise.
* g++.old-deja/g++.eh/cleanup2.C: Likewise.
* g++.old-deja/g++.eh/badalloc1.C: Likewise.
* g++.old-deja/g++.eh/throw2.C: Likewise.
* g++.old-deja/g++.eh/throw1.C: Likewise.
* g++.old-deja/g++.eh/tmpl1.C: Likewise.
* g++.old-deja/g++.other/new7.C: Likewise.
* g++.old-deja/g++.other/crash30.C: Likewise.
* g++.old-deja/g++.other/regstack.C: Likewise.
* g++.old-deja/g++.other/crash28.C: Likewise.
* g++.old-deja/g++.jason/bool5.C: Likewise.
* g++.old-deja/g++.mike/p10416.C: Likewise.
* g++.old-deja/g++.mike/eh25.C: Likewise.
* g++.old-deja/g++.mike/eh55.C: Likewise.
libcpp/
* include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z
to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17.
* init.c (lang_defaults, cpp_init_builtins): Likewise.
* expr.c (cpp_classify_number): Use C++17 instead of C++1z
in diagnostics.
libstdc++-v3/
* testsuite/libstdc++-prettyprinters/cxx17.cc: Use -std=c++17 or
-std=gnu++17 instead of -std=c++1z or -std=gnu++1z. Use c++17 instead
of c++1z and c++17_only instead of c++1z_only. Adjust expected
diagnostics and comments refering to 1z to 17.
* testsuite/30_threads/lock_guard/cons/deduction.cc: Likewise.
* testsuite/30_threads/scoped_lock/cons/deduction.cc: Likewise.
* testsuite/30_threads/scoped_lock/cons/1.cc: Likewise.
* testsuite/30_threads/scoped_lock/requirements/typedefs.cc: Likewise.
* testsuite/30_threads/scoped_lock/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/30_threads/unique_lock/cons/deduction.cc: Likewise.
* testsuite/18_support/launder/1.cc (test02): Likewise.
* testsuite/18_support/launder/requirements_neg.cc: Likewise.
* testsuite/18_support/launder/requirements.cc: Likewise.
* testsuite/18_support/byte/requirements.cc: Likewise.
* testsuite/18_support/byte/ops.cc: Likewise.
* testsuite/18_support/byte/global_neg.cc: Likewise.
* testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc:
Likewise.
* testsuite/27_io/types/4.cc: Likewise.
* testsuite/25_algorithms/sample/81221.cc: Likewise.
* testsuite/25_algorithms/sample/1.cc: Likewise.
* testsuite/25_algorithms/sample/2.cc: Likewise.
* testsuite/25_algorithms/search/searcher.cc: Likewise.
* testsuite/28_regex/basic_regex/ctors/deduction.cc: Likewise.
* testsuite/experimental/filesystem/path/construct/string_view.cc:
Likewise.
* testsuite/24_iterators/range_access_cpp17.cc: Likewise.
* testsuite/24_iterators/container_access.cc: Likewise.
* testsuite/ext/pb_ds/regression/hash_map_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/trie_set_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/hash_set_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/list_update_set_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/list_update_map_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/priority_queue_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/tree_set_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/tree_map_rand.cc: Likewise.
* testsuite/ext/pb_ds/regression/trie_map_rand.cc: Likewise.
* testsuite/20_util/shared_ptr/casts/reinterpret.cc: Likewise.
* testsuite/20_util/shared_ptr/cons/deduction.cc: Likewise.
* testsuite/20_util/shared_ptr/cons/array.cc: Likewise.
* testsuite/20_util/shared_ptr/observers/array.cc (struct A): Likewise.
* testsuite/20_util/pair/cons/deduction.cc: Likewise.
* testsuite/20_util/variant/deduction.cc: Likewise.
* testsuite/20_util/tuple/78939.cc: Likewise.
* testsuite/20_util/tuple/cons/deduction.cc: Likewise.
* testsuite/20_util/void_t/1.cc: Likewise.
* testsuite/20_util/duration/arithmetic/constexpr_c++17.cc: Likewise.
* testsuite/20_util/unique_ptr/cons/deduction_neg.cc: Likewise.
* testsuite/20_util/addressof/requirements/constexpr.cc: Likewise.
* testsuite/20_util/weak_ptr/cons/deduction.cc: Likewise.
* testsuite/20_util/has_unique_object_representations/requirements/typedefs.cc:
Likewise.
* testsuite/20_util/has_unique_object_representations/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/has_unique_object_representations/value.cc:
Likewise.
* testsuite/20_util/time_point/arithmetic/constexpr.cc: Likewise.
* testsuite/20_util/function_objects/invoke/59768.cc: Likewise.
* testsuite/20_util/function_objects/mem_fn/80478.cc: Likewise.
* testsuite/20_util/function/cons/deduction.cc: Likewise.
* testsuite/20_util/specialized_algorithms/memory_management_tools/destroy_neg.cc:
Likewise.
* testsuite/20_util/is_aggregate/requirements/typedefs.cc: Likewise.
* testsuite/20_util/is_aggregate/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/is_aggregate/value.cc: Likewise.
* testsuite/26_numerics/lcm/1.cc: Likewise.
* testsuite/26_numerics/lcm/lcm_neg.cc: Likewise.
* testsuite/26_numerics/gcd/1.cc: Likewise.
* testsuite/26_numerics/gcd/gcd_neg.cc: Likewise.
* testsuite/26_numerics/valarray/deduction.cc: Likewise.
* testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc: Likewise.
* testsuite/26_numerics/headers/cmath/hypot.cc: Likewise.
* testsuite/23_containers/queue/members/emplace_cxx17_return.cc:
Likewise.
* testsuite/23_containers/array/cons/deduction.cc: Likewise.
* testsuite/23_containers/array/cons/deduction_neg.cc: Likewise.
* testsuite/23_containers/deque/modifiers/emplace/cxx17_return.cc:
Likewise.
* testsuite/23_containers/deque/cons/deduction.cc: Likewise.
* testsuite/23_containers/stack/members/emplace_cxx17_return.cc:
Likewise.
* testsuite/23_containers/list/modifiers/emplace/cxx17_return.cc:
Likewise.
* testsuite/23_containers/list/cons/deduction.cc: Likewise.
* testsuite/23_containers/forward_list/modifiers/emplace_cxx17_return.cc:
Likewise.
* testsuite/23_containers/forward_list/cons/deduction.cc: Likewise.
* testsuite/23_containers/unordered_set/allocator/ext_ptr.cc: Likewise.
* testsuite/23_containers/vector/modifiers/emplace/cxx17_return.cc:
Likewise.
* testsuite/23_containers/vector/cons/deduction.cc: Likewise.
* testsuite/23_containers/vector/bool/emplace_cxx17_return.cc:
Likewise.
* testsuite/21_strings/basic_string/cons/char/9.cc: Likewise.
* testsuite/21_strings/basic_string/cons/char/deduction.cc: Likewise.
* testsuite/21_strings/basic_string/cons/char/79162.cc: Likewise.
* testsuite/21_strings/basic_string/cons/wchar_t/9.cc: Likewise.
* testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc:
Likewise.
* testsuite/21_strings/basic_string/cons/wchar_t/79162.cc: Likewise.
* testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc:
Likewise.
From-SVN: r252826
2017-09-15 18:15:46 +02:00
Jonathan Wakely
d0dda80415
PR libstdc++/81468 constrain std::chrono::time_point constructor
...
PR libstdc++/81468
* include/std/chrono (__enable_if_is_duration)
(__disable_if_is_duration): New alias templates to simplify SFINAE.
(duration_cast, floor, ceil): Use __enable_if_is_duration.
(duration::__is_float, duration::__is_harmonic): New alias templates
to simplify SFINAE.
(duration::duration(const _Rep2&)): Use _Require, __is_float and
__is_harmonic.
(duration::duration(const duration<_Rep2, _Period2>&)): Likewise.
(__common_rep_type): Remove, replace with ...
(__common_rep_t): New alias template.
(operator*, operator/, operator%): Use __common_rep_t and
__disable_if_is_duration.
(time_point::time_point(const time_point<clock, _Dur2>&)): Add missing
constraint from LWG DR 1177.
* testsuite/20_util/duration/cons/dr1177.cc: New.
* testsuite/20_util/duration/literals/range.cc: Update dg-error line.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
* testsuite/20_util/time_point/cons/81468.cc: New.
From-SVN: r252085
2017-09-13 15:07:44 +01:00
Jonathan Wakely
c29730ec17
Fix broken URLs in libstdc++ API docs
...
* doc/doxygen/mainpage.html: Fix broken URLs.
From-SVN: r252070
2017-09-13 11:17:44 +01:00
Jonathan Wakely
ff7e6f066b
PR libstdc++/81835 fix broken URLs in libstdc++ docs
...
PR libstdc++/81835
* doc/xml/manual/extensions.xml: Replace unstable URL.
* doc/html/manual/ext_demangling.html: Regenerate.
* libsupc++/cxxabi.h (__cxa_demangle): Fix broken URL.
From-SVN: r252066
2017-09-13 11:05:59 +01:00
Jonathan Wakely
2af96386a6
Define std::__to_address helper
...
* include/bits/allocated_ptr.h (__allocated_ptr::get): Use
__to_address.
(__allocated_ptr::_S_raw_ptr): Remove.
* include/bits/forward_list.h (_Fwd_list_base::_M_get_node): Use
__to_address.
* include/bits/hashtable_policy.h (_Hashtable_alloc): Likewise.
* include/bits/ptr_traits.h (__to_address): Define new function
template.
* include/bits/shared_ptr_base.h (__shared_ptr): Use __to_address.
(__shared_ptr::_S_raw_ptr): Remove.
* include/bits/stl_vector.h [__cplusplus >= 201103L]
(vector::_M_data_ptr): Use __to_address.
[__cplusplus < 201103L] (vector::_M_data_ptr): Don't dereference
possibly invalid pointers.
* include/ext/alloc_traits.h (__alloc_traits::construct)
(__alloc_traits::destroy): Use __to_address.
From-SVN: r252055
2017-09-13 08:27:40 +01:00
Jonathan Wakely
d681026df1
PR libstdc++/79433 no #error for including TS headers with wrong -std
...
PR libstdc++/79433
* include/Makefile.am: Remove <bits/c++14_warning.h>.
* include/Makefile.in: Regenerate.
* include/bits/c++14_warning.h: Remove.
* include/experimental/algorithm: Do not include <c++14_warning.h>.
* include/experimental/any: Likewise.
* include/experimental/array: Likewise.
* include/experimental/bits/erase_if.h: Likewise.
* include/experimental/bits/lfts_config.h: Likewise.
* include/experimental/bits/shared_ptr.h: Likewise.
* include/experimental/bits/string_view.tcc: Likewise.
* include/experimental/chrono: Likewise.
* include/experimental/deque: Likewise.
* include/experimental/filesystem: Do not include <c++0x_warning.h>.
* include/experimental/forward_list: Do not include <c++14_warning.h>.
* include/experimental/functional: Likewise.
* include/experimental/iterator: Likewise.
* include/experimental/list: Likewise.
* include/experimental/map: Likewise.
* include/experimental/memory: Likewise.
* include/experimental/numeric: Likewise.
* include/experimental/optional: Likewise.
* include/experimental/propagate_const: Likewise.
* include/experimental/ratio: Likewise.
* include/experimental/regex: Likewise.
* include/experimental/set: Likewise.
* include/experimental/string: Likewise.
* include/experimental/string_view: Likewise.
* include/experimental/system_error: Likewise.
* include/experimental/tuple: Likewise.
* include/experimental/type_traits: Likewise.
* include/experimental/unordered_map: Likewise.
* include/experimental/unordered_set: Likewise.
* include/experimental/vector: Likewise.
* testsuite/experimental/any/misc/any_cast_neg.cc: Adjust dg-error
line number.
* testsuite/experimental/array/neg.cc: Likewise.
* testsuite/experimental/propagate_const/assignment/move_neg.cc:
Likewise.
* testsuite/experimental/propagate_const/cons/move_neg.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.
From-SVN: r252019
2017-09-12 15:03:06 +01:00
Jonathan Wakely
c6888c6257
PR libstdc++/79433 no #error for including headers with wrong -std
...
PR libstdc++/79433
* doc/xml/manual/status_cxx2017.xml: Update feature-test macros.
* doc/html/*: Regenerate.
* include/Makefile.am: Remove <bits/c++17_warning.h>.
* include/Makefile.in: Regenerate.
* include/bits/c++17_warning.h: Remove.
* include/bits/string_view.tcc: Do not include <bits/c++17_warning.h>
for pre-C++17 modes.
* include/std/any: Likewise.
(__cpp_lib_any): Define.
* include/std/mutex (__cpp_lib_scoped_lock): Adjust value as per new
SD-6 draft.
* include/std/numeric (__cpp_lib_gcd_lcm): Define as per new SD-6
draft.
* include/std/optional: Do not include <bits/c++17_warning.h>.
(__cpp_lib_optional): Define.
* include/std/shared_mutex: Do not include <bits/c++14_warning.h>.
* include/std/string_view: Do not include <bits/c++17_warning.h>.
(__cpp_lib_string_view): Define.
* include/std/variant: Do not include <bits/c++17_warning.h>.
(__cpp_lib_variant): Define.
* testsuite/20_util/optional/cons/value_neg.cc: Adjust dg-error line
numbers.
* testsuite/26_numerics/gcd/1.cc: Test for __cpp_lib_gcd_lcm.
* testsuite/26_numerics/gcd/gcd_neg.cc: Adjust dg-error line
numbers.
* testsuite/26_numerics/lcm/1.cc: Test for __cpp_lib_gcd_lcm.
* testsuite/26_numerics/lcm/lcm_neg.cc: Adjust dg-error line
numbers.
* testsuite/30_threads/scoped_lock/requirements/typedefs.cc: Adjust
expected value of __cpp_lib_scoped_lock.
From-SVN: r252018
2017-09-12 15:02:59 +01:00
Jonathan Wakely
2be7a166a9
PR libstdc++/70483 make std::experimental::string_view fully constexpr
...
PR libstdc++/70483
* include/experimental/bits/string_view.tcc (basic_string_view::find)
(basic_string_view::rfind, basic_string_view::find_first_of)
(basic_string_view::find_last_of, basic_string_view::find_first_not_of)
(basic_string_view::find_last_not_of): Add constexpr specifier.
* include/experimental/string_view (basic_string_view::remove_prefix)
(basic_string_view::remove_suffix, basic_string_view::swap)
(basic_string_view::compare, basic_string_view::find)
(basic_string_view::rfind, basic_string_view::find_first_of)
(basic_string_view::find_last_of, basic_string_view::find_first_not_of)
(basic_string_view::find_last_not_of, operator==, operator!=)
(operator<, operator>, operator<=, operator>=): Likewise.
* testsuite/experimental/string_view/operations/compare/char/70483.cc:
New.
From-SVN: r252017
2017-09-12 14:31:20 +01:00
Jonathan Wakely
c5ae1a27bd
PR libstdc++/70483 make std::string_view fully constexpr
...
PR libstdc++/70483
* include/bits/string_view.tcc (basic_string_view::find)
(basic_string_view::rfind, basic_string_view::find_first_of)
(basic_string_view::find_last_of, basic_string_view::find_first_not_of)
(basic_string_view::find_last_not_of): Add constexpr specifier.
* include/std/string_view (basic_string_view::operator=)
(basic_string_view::rbegin, basic_string_view::rend)
(basic_string_view::crbegin, basic_string_view::crend)
(basic_string_view::remove_prefix, basic_string_view::remove_suffix)
(basic_string_view::swap, basic_string_view::compare)
(basic_string_view::find, basic_string_view::rfind)
(basic_string_view::find_first_of, basic_string_view::find_last_of)
(basic_string_view::find_first_not_of)
(basic_string_view::find_last_not_of, basic_string_view::_M_check)
(basic_string_view::_M_limit, operator==, operator!=, operator<)
(operator>, operator<=, operator>=): Likewise.
* testsuite/21_strings/basic_string_view/modifiers/remove_prefix/
char/1.cc: Repeat tests in constexpr context.
* testsuite/21_strings/basic_string_view/modifiers/remove_prefix/
wchar_t/1.cc: Likewise.
* testsuite/21_strings/basic_string_view/modifiers/remove_suffix/
char/1.cc: Likewise.
* testsuite/21_strings/basic_string_view/modifiers/remove_suffix/
wchar_t/1.cc: Likewise.
* testsuite/21_strings/basic_string_view/operations/find/char/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/char/3.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/find/wchar_t/3.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operators/char/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operators/wchar_t/2.cc:
Likewise.
* testsuite/21_strings/basic_string_view/range_access/char/1.cc: Test
cbegin, cend, rbegin, rend, crbegin and crend.
* testsuite/21_strings/basic_string_view/range_access/wchar_t/1.cc:
Likewise.
* testsuite/21_strings/basic_string_view/operations/compare/char/1.cc:
Remove trailing whitespace.
* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/
1.cc: Likewise.
* testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc:
New.
* testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc:
New.
* testsuite/21_strings/basic_string_view/operations/compare/char/2.cc:
New.
* testsuite/21_strings/basic_string_view/operations/compare/wchar_t/
2.cc: New.
From-SVN: r251988
2017-09-11 22:47:41 +01:00
Tim Shen
3366a47408
re PR libstdc++/71500 (regex::icase only works on first character in a range)
...
PR libstdc++/71500
* include/bits/regex_executor.tcc: Support icase in regex_tratis<...>
for back reference matches.
* testsuite/28_regex/regression.cc: Test case.
From-SVN: r251982
2017-09-11 19:02:34 +00:00
Jonathan Wakely
47d7966a70
Adjust test to pass with old std::string
...
* testsuite/21_strings/basic_string/lwg2946.cc: Adjust for
compatibility with old COW std::string.
From-SVN: r251981
2017-09-11 17:54:57 +01:00
Gerald Pfeifer
630e912e68
allocator.xml: Adjust link for Hoard.
...
* doc/xml/manual/allocator.xml: Adjust link for Hoard.
* doc/html/manual/memory.html: Regenerate.
From-SVN: r251919
2017-09-09 06:51:49 +00:00
Daniel Kruegler
df66af3b1e
PR libstdc++/79162 implement LWG 2946 and LWG 2758
...
2017-09-04 Daniel Kruegler <daniel.kruegler@gmail.com>
PR libstdc++/79162
Implement LWG 2946, LWG 2758's resolution missed further corrections
* include/bits/basic_string.h (basic_string::compare): Add missing
required noexcept specifications.
(basic_string): Introduce internal _S_to_string_view and __sv_wrapper
for implicit string_view conversion.
(basic_string::basic_string): Fix explicit string_view conversion by
implicit conversion using _S_to_string_view and __sv_wrapper.
(basic_string): Introduce internal basic_string(__sv_wrapper, Alloc)
constructor.
(basic_string): Fix operator=(T) template by operator=(const T&)
template for uncopyable types (PR 79162).
(basic_string::operator+=, basic_string::append, basic_string::assign)
(basic_string::insert, basic_string::replace, basic_string::find)
(basic_string::rfind, basic_string::find_first_of)
(basic_string::find_last_of, basic_string::find_first_not_of)
(basic_string::find_last_not_of, basic_string::compare): Replace
__sv_type argument by template const T& (LWG 2946) and correct
documentation describing __sv_type argument.
(basic_string::find, basic_string::rfind, basic_string::find_first_of)
(basic_string::find_last_of, basic_string::find_first_not_of)
(basic_string::find_last_not_of, basic_string::compare): Replace
unconditional noexcept specification by conditional noexcept
specification to partially balance the removal of noexcept by LWG 2946.
* testsuite/21_strings/basic_string/79162.cc: New.
* testsuite/21_strings/basic_string/lwg2946.cc: New.
From-SVN: r251664
2017-09-04 16:48:47 +01:00
Jonathan Wakely
89c6ecfa4c
PR c++/82039 suppress -Wzero-as-null-pointer-constant warning
...
PR c++/82039
* include/ext/new_allocator.h (__gnu_cxx::new_allocator::allocate):
Adjust null pointer constant to avoid warning.
From-SVN: r251570
2017-08-31 17:45:37 +01:00
François Dumont
55500f5d28
stl_list.h [!_GLIBCXX_INLINE_VERSION](_List_base<>::_S_distance): Remove.
...
2017-08-24 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_list.h
[!_GLIBCXX_INLINE_VERSION](_List_base<>::_S_distance): Remove.
(_List_impl(_Node_alloc_type&&, _List_impl&&)): New.
(_List_base(_Node_alloc_type&&, _List_base&&)): New, use latter.
[!_GLIBCXX_INLINE_VERSION](_List_base(_Node_alloc_type&&,_List_base&&)):
Remove.
(_List_base(_Node_alloc_type&&)): New.
[!_GLIBCXX_INLINE_VERSION](_List_base<>::_M_distance): Remove.
[!_GLIBCXX_INLINE_VERSION](_List_base<>::_M_node_count): Remove.
(list<>::_M_node_count): New.
(list<>::size()): Adapt to call latter.
(list<>::_S_distance(const_iterator, const_iterator)): New.
(list<>::splice(iterator, list&, const_iterator, const_iterator)):
Adapt to call latter.
(list(list&&, const allocator_type&, true_type)): New.
(list(list&&, const allocator_type&, false_type)): New.
(list(list&&, const allocator_type&)): Adapt to call latters.
From-SVN: r251342
2017-08-24 20:31:53 +00:00
Jonathan Wakely
2c0378f467
PR libstdc++/81912 make std::__iterator_category constexpr
...
PR libstdc++/81912
* include/bits/stl_iterator_base_types.h (__iterator_category): Add
constexpr for C++11 and later.
* testsuite/24_iterators/container_access.cc: Add target selector.
* testsuite/24_iterators/range_access.cc: Fix clause number in
comment.
* testsuite/24_iterators/range_access_cpp14.cc: Likewise.
* testsuite/24_iterators/range_access_cpp17.cc: New.
From-SVN: r251234
2017-08-21 16:14:27 +01:00
Richard Biener
1ea85365b4
re PR go/78628 (GO fails to build a translation unit decl)
...
2017-08-21 Richard Biener <rguenther@suse.de>
include/
* simple-object.h (simple_object_copy_lto_debug_sections): New
function.
libiberty/
* simple-object-common.h (struct simple_object_functions): Add
copy_lto_debug_sections hook.
* simple-object.c: Include fcntl.h.
(handle_lto_debug_sections): New helper function.
(simple_object_copy_lto_debug_sections): New function copying
early LTO debug sections to regular debug sections in a new file.
(simple_object_start_write): Handle NULL segment_name.
* simple-object-coff.c (simple_object_coff_functions): Adjust
for not implemented copy_lto_debug_sections hook.
* simple-object-mach-o.c (simple_object_mach_o_functions): Likewise.
* simple-object-xcoff.c (simple_object_xcoff_functions): Likewise.
* simple-object-elf.c (SHT_NULL, SHT_SYMTAB, SHT_RELA, SHT_REL,
SHT_GROUP): Add various sectopn header types.
(SHF_EXCLUDE): Add flag.
(Elf32_External_Sym, Elf64_External_Sym): Add symbol struct.
(ELF_ST_BIND, ELF_ST_TYPE, ELF_ST_INFO): Add accessors.
(STT_OBJECT, STT_FUNC, STT_TLS, STT_GNU_IFUNC): Add Symbol types.
(STV_DEFAULT): Add symbol visibility.
(SHN_COMMON): Add special section index name.
(struct simple_object_elf_write): New.
(simple_object_elf_start_write): Adjust for new private data.
(simple_object_elf_write_shdr): Pass in values for all fields
we write.
(simple_object_elf_write_to_file): Adjust. Copy from recorded
section headers if requested.
(simple_object_elf_release_write): Release private data.
(simple_object_elf_copy_lto_debug_sections): Copy and rename sections
as denoted by PFN and all their dependences, symbols and relocations
to the empty destination file.
(simple_object_elf_functions): Adjust for copy_lto_debug_sections hook.
gcc/
* debug.h (struct gcc_debug_hooks): Add die_ref_for_decl and
register_external_die hooks.
(debug_false_tree_charstarstar_uhwistar): Declare.
(debug_nothing_tree_charstar_uhwi): Likewise.
* debug.c (do_nothing_debug_hooks): Adjust.
(debug_false_tree_charstarstar_uhwistar): New do nothing.
(debug_nothing_tree_charstar_uhwi): Likewise.
* dbxout.c (dbx_debug_hooks): Adjust.
(xcoff_debug_hooks): Likewise.
* sdbout.c (sdb_debug_hooks): Likewise.
* vmsdbgout.c (vmsdbg_debug_hooks): Likewise.
* dwarf2out.c (macinfo_label_base): New global.
(dwarf2out_register_external_die): New function for the
register_external_die hook.
(dwarf2out_die_ref_for_decl): Likewise for die_ref_for_decl.
(dwarf2_debug_hooks): Use them.
(dwarf2_lineno_debug_hooks): Adjust.
(struct die_struct): Add with_offset flag.
(DEBUG_LTO_DWO_INFO_SECTION, DEBUG_LTO_INFO_SECTION,
DEBUG_LTO_DWO_ABBREV_SECTION, DEBUG_LTO_ABBREV_SECTION,
DEBUG_LTO_DWO_MACINFO_SECTION, DEBUG_LTO_MACINFO_SECTION,
DEBUG_LTO_DWO_MACRO_SECTION, DEBUG_LTO_MACRO_SECTION,
DEBUG_LTO_LINE_SECTION, DEBUG_LTO_DWO_STR_OFFSETS_SECTION,
DEBUG_LTO_STR_DWO_SECTION, DEBUG_STR_LTO_SECTION): New macros
defining section names for the early LTO debug variants.
(reset_indirect_string): New helper.
(add_AT_external_die_ref): Helper for dwarf2out_register_external_die.
(print_dw_val): Add support for offsetted symbol references.
(get_ultimate_context): Split out from is_cxx.
(is_cxx): Use get_ultimate_context.
(is_fortran): Add decl overload.
(compute_comp_unit_symbol): Split out worker from
compute_section_prefix.
(compute_section_prefix): Call compute_comp_unit_symbol and
set comdat_type_p here.
(output_die): Skip DIE symbol output for the LTO added one.
Handle DIE symbol references with offset.
(output_comp_unit): Guard section name mangling properly.
For LTO debug sections emit a symbol at the section beginning
which we use to refer to its DIEs.
(add_abstract_origin_attribute): For DIEs registered via
dwarf2out_register_external_die directly refer to the early
DIE rather than indirectly through the shadow one we created.
Remove obsolete call to dwarf2out_abstract_function for
non-function/block origins.
(gen_array_type_die): When generating early LTO debug do
not emit DW_AT_string_length.
(gen_formal_parameter_die): Do not re-create DIEs for PARM_DECLs
late when in LTO. As suggested place a gcc_unreachable for
the DECL_ABSTRACT_P case.
(gen_subprogram_die): Avoid another specification DIE
for early built declarations/definitions for the late LTO case.
(gen_variable_die): Add type references for late duplicated VLA dies
when in late LTO.
(gen_inlined_subroutine_die): Do not call dwarf2out_abstract_function,
we have the abstract instance already.
(process_scope_var): Adjust decl DIE contexts in LTO which
first puts them in limbo.
(gen_decl_die): Do not generate type DIEs late apart from
types for VLAs or for decls we do not yet have a DIE. Do not
call dwarf2out_abstract_function late.
(dwarf2out_early_global_decl): Make sure to create DIEs
for abstract instances of a decl first.
(dwarf2out_late_global_decl): Adjust comment.
(output_macinfo_op): With multiple macro sections use
macinfo_label_base to distinguish labels.
(output_macinfo): Likewise. Update macinfo_label_base.
Pass in the line info label.
(note_variable_value_in_expr): When generating LTO resolve
all variable values here by generating DIEs as needed.
(init_sections_and_labels): Add early LTO debug flag parameter
and generate different sections and names if set. Add generation
counter for the labels so we can have multiple of them.
(reset_dies): Helper to allow DIEs to be output multiple times.
(dwarf2out_finish): When outputting DIEs to the fat part of an
LTO object first reset DIEs.
(dwarf2out_early_finish): Output early DIEs when generating LTO.
(modified_type_die): Check for decl_ultimate_origin being self
before recursing.
(gen_type_die_with_usage): Likewise.
(gen_typedef_die): Allow decl_ultimate_origin being self.
(set_decl_abstract_flags): Remove.
(set_block_abstract_flags): Likewise.
(dwarf2out_abstract_function): Treat the early generated DIEs
as the abstract copy and only add DW_AT_inline and
DW_AT_artificial here and call set_decl_origin_self.
If the DIE has an abstract origin don't do anything.
* tree.c (free_lang_data): Build a dummy TRANSLATION_UNIT_DECL
if we have none yet (Go fails to build one, PR78628).
(variably_modified_type_p): Prevent endless recursion for Ada
cyclic pointer types.
* lto-streamer-in.c: Include debug.h.
(dref_queue): New global.
(lto_read_tree_1): Stream in DIE references.
(lto_input_tree): Register DIE references.
(input_function): Stream DECL_DEBUG_ARGS.
* lto-streamer-out.c: Include debug.h.
(lto_write_tree_1): Output DIE references.
(DFS::DFS_write_tree_body): Follow DECL_ABSTRACT_ORIGIN.
Force a TRANSLATION_UNIT_DECL DECL_CONTEXT for file-scope decls.
(output_function): Stream DECL_DEBUG_ARGS.
* tree-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
Stream DECL_ABSTRACT_ORIGIN.
* tree-streamer-out.c (write_ts_decl_common_tree_pointers): Likewise.
(write_ts_decl_minimal_tree_pointers): Force a TRANSLATION_UNIT_DECL
DECL_CONTEXT for file-scope decls.
* lto-streamer.h (struct dref_entry): Declare.
(dref_queue): Likewise.
* cfgexpand.c (pass_expand::execute): Do not call the
outlining_inline_function hook here.
* lto-wrapper.c (debug_obj): New global.
(tool_cleanup): Unlink it if required.
(debug_objcopy): New function.
(run_gcc): Handle early debug sections in the IL files by
extracting them to separate files, partially linkin them and
feeding the result back as result to the linker.
* config/darwin.h (DEBUG_LTO_INFO_SECTION, DEBUG_LTO_ABBREV_SECTION,
DEBUG_LTO_MACINFO_SECTION, DEBUG_LTO_LINE_SECTION,
DEBUG_STR_LTO_SECTION, DEBUG_LTO_MACRO_SECTION): Put early debug
sections into a separate segment.
* config/darwin.c (darwin_asm_named_section): Handle __GNU_DWARF_LTO
segments.
(darwin_asm_dwarf_section): Likewise.
(darwin_asm_output_dwarf_offset): Likewise.
* config/i386/i386.c (make_resolver_func): Set DECL_IGNORED_P.
lto/
* lto.c (unify_scc): Truncate DIE reference queue for dropped SCCs.
(lto_read_decls): Process TRANSLATION_UNIT_DECLs. Remove
TYPE_DECL debug processing, register DIE references from
prevailing SCCs with the debug machinery.
(lto_section_with_id): Handle LTO debug sections.
libstdc++/
* testsuite/libstdc++-prettyprinters/prettyprinters.exp: Run all
tests with -flto as well if supported.
testsuite/
* c-c++-common/asan/global-overflow-1.c: Adjust diagnostic location
regex to handle the LTO case.
* c-c++-common/asan/heap-overflow-1.c: Likewise.
* c-c++-common/asan/misalign-1.c: Likewise.
* c-c++-common/asan/misalign-2.c: Likewise.
* c-c++-common/asan/null-deref-1.c: Likewise.
* c-c++-common/asan/stack-overflow-1.c: Likewise.
* c-c++-common/asan/strncpy-overflow-1.c: Likewise.
* c-c++-common/asan/use-after-free-1.c: Likewise.
* c-c++-common/asan/alloca_big_alignment.c: Likewise.
* c-c++-common/asan/alloca_detect_custom_size.c: Likewise.
* c-c++-common/asan/alloca_overflow_partial.c: Likewise.
* c-c++-common/asan/alloca_overflow_right.c: Likewise.
* c-c++-common/asan/alloca_underflow_left.c: Likewise.
* g++.dg/asan/large-func-test-1.C: Likewise.
* gfortran.dg/save_6.f90: Add -flto -g variant of save_5.f90.
From-SVN: r251220
2017-08-21 10:29:00 +00:00
Martin Sebor
be56159c65
re PR c/81854 (weak alias of an incompatible symbol accepted)
...
libstdc++/ChangeLog:
PR c/81854
* src/c++98/compatibility.cc (_GLIBCXX_3_4_SYMVER): Declare alias
target as a C++ function with no prototype.
(_GLIBCXX_3_4_5_SYMVER): Ditto.
From-SVN: r251211
2017-08-20 15:31:39 -06:00
John David Anglin
1104d918b5
Fix typo.
...
From-SVN: r251210
2017-08-20 19:03:36 +00:00