fc6f7d1a210933db83cad620d78832c42af2a859
[gcc.git] / libstdc++-v3 / ChangeLog
1 2019-01-29 Jonathan Wakely <jwakely@redhat.com>
2
3 * testsuite/20_util/reference_wrapper/result_type.cc: Disable for
4 C++2a.
5 * testsuite/20_util/reference_wrapper/typedefs-2.cc: Likewise.
6 * testsuite/20_util/reference_wrapper/typedefs-3.cc: Likewise.
7 * testsuite/20_util/reference_wrapper/typedefs.cc: Likewise.
8 * testsuite/30_threads/async/54297.cc: Suppress nodiscard warning.
9 * testsuite/ext/array_allocator/26875.cc: Likewise.
10 * testsuite/ext/pool_allocator/allocate_chunk.cc: Likewise.
11 * testsuite/util/replacement_memory_operators.h: Likewise.
12 * testsuite/util/testsuite_allocator.h: Likewise.
13
14 * include/std/memory_resource (__pool_resource::_M_unpooled): Use
15 normal mode vector, even for debug mode.
16 * include/std/vector [_GLIBCXX_DEBUG] (_GLIBCXX_STD_C::pmr::vector):
17 Define alias template for normal mode vector.
18
19 2019-01-28 Jonathan Wakely <jwakely@redhat.com>
20
21 PR libstdc++/68737
22 * config/locale/generic/c_locale.h (__convert_from_v)
23 [_GLIBCXX_USE_C99_STDIO]: Also check _GLIBCXX_HAVE_BROKEN_VSNPRINTF.
24 * config/os/hpux/os_defines.h: Define _GLIBCXX_HAVE_BROKEN_VSNPRINTF.
25 * include/bits/locale_facets.tcc (num_put::_M_insert_float)
26 [_GLIBCXX_USE_C99_STDIO]: Also check _GLIBCXX_HAVE_BROKEN_VSNPRINTF.
27
28 2019-01-24 Jonathan Wakely <jwakely@redhat.com>
29
30 PR libstdc++/88840
31 * include/bits/stl_vector.h (vector::__use_relocate): Replace static
32 data member with static member function _S_use_relocate().
33 * include/bits/vector.tcc (vector::reserve, vector::_M_realloc_insert)
34 (vector::_M_default_append): Use _S_use_relocate() instead of
35 __use_relocate.
36
37 * testsuite/27_io/filesystem/path/compare/strings.cc: Only compare
38 sign of results.
39
40 2019-01-22 Jonathan Wakely <jwakely@redhat.com>
41
42 PR libstdc++/88740
43 * testsuite/util/testsuite_hooks.h [stderr] (VERIFY): Use fprintf to
44 write to stderr instead of using printf.
45
46 2019-01-21 Jakub Jelinek <jakub@redhat.com>
47
48 PR libstdc++/86590
49 * include/bits/char_traits.h (__constant_string_p,
50 __constant_char_array_p): Use __builtin_is_constant_evaluated if
51 available.
52
53 2019-01-20 Ulrich Drepper <drepper@redhat.com>
54
55 Implement C++20 P0600r1.
56 * include/backward/hash_map: Add nodiscard attribute to empty.
57 * include/backward/hash_set: Likewise.
58 * backward/hashtable.h: Likewise.
59 * include/bits/basic_string.h: Likewise.
60 * include/bits/forward_list.h: Likewise.
61 * include/bits/hashtable.h: Likewise.
62 * include/bits/regex.h: Likewise.
63 * include/bits/stl_deque.h: Likewise.
64 * include/bits/stl_list.h: Likewise.
65 * include/bits/stl_map.h: Likewise.
66 * include/bits/stl_multimap.h: Likewise.
67 * include/bits/stl_multiset.h: Likewise.
68 * include/bits/stl_queue.h: Likewise.
69 * include/bits/stl_set.h: Likewise.
70 * include/bits/stl_stack.h: Likewise.
71 * include/bits/stl_tree.h: Likewise.
72 * include/bits/stl_vector.h: Likewise.
73 * include/bits/unordered_map.h: Likewise.
74 * include/bits/unordered_set.h: Likewise.
75 * include/debug/array: Likewise.
76 * include/experimental/any: Likewise.
77 * include/experimental/bits/fs_path.h: Likewise.
78 * include/experimental/internet: Likewise.
79 * include/experimental/string_view: Likewise.
80 * include/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp:
81 Likewise.
82 * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp:
83 Likewise.
84 * include/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp:
85 Likewise.
86 * include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp:
87 Likewise.
88 * include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp:
89 Likewise.
90 * include/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp:
91 Likewise.
92 * include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp:
93 Likewise.
94 * include/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp:
95 Likewise.
96 * include/ext/pb_ds/detail/left_child_next_sibling_heap_/
97 info_fn_imps.hpp: Likewise.
98 * include/ext/pb_ds/detail/left_child_next_sibling_heap_/
99 left_child_next_sibling_heap_.hpp: Likewise.
100 * include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp:
101 Likewise.
102 * include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp:
103 Likewise.
104 * include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp:
105 Likewise.
106 * include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hp:
107 Likewise.
108 * include/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp:
109 Likewise.
110 * include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp:
111 Likewise.
112 * include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp:
113 Likewise.
114 * include/ext/pb_ds/detail/tree_trace_base.hpp: Likewise.
115 * include/ext/pb_ds/trie_policy.hpp: Likewise.
116 * include/ext/rope: Likewise.
117 * include/ext/slist: Likewise.
118 * include/ext/vstring.h: Likewise.
119 * include/profile/array: Likewise.
120 * include/std/array: Likewise.
121 * include/tr1/array: Likewise.
122 * include/tr1/hashtable.h: Likewise.
123 * include/tr1/regex: Likewise.
124 * include/tr2/dynamic_bitset: Likewise.
125 * include/bits/alloc_traits.h: Add nodiscard attribute to
126 allocate.
127 * include/experimental/memory_resource: Likewise.
128 * include/ext/alloc_traits.h: Likewise.
129 * include/ext/array_allocator.h: Likewise.
130 * include/ext/bitmap_allocator.h: Likewise.
131 * include/ext/debug_allocator.h: Likewise.
132 * include/ext/extptr_allocator.h: Likewise.
133 * include/ext/mt_allocator.h: Likewise.
134 * include/ext/new_allocator.h: Likewise.
135 * include/ext/pool_allocator.h: Likewise.
136 * include/ext/throw_allocator.h: Likewise.
137 * include/std/scoped_allocator: Likewise.
138 * libsupc++/eh_alloc.cc: Likewise.
139 * include/std/future: Add nodiscard attribute to async.
140 * libsupc++/new: Add nodiscard attribute to new.
141
142 2019-01-18 Jonathan Wakely <jwakely@redhat.com>
143
144 PR libstdc++/87514
145 PR libstdc++/87520
146 PR libstdc++/88782
147 * config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Export new symbol.
148 * include/bits/shared_ptr.h
149 (shared_ptr(_Sp_make_shared_tag, const Alloc&, Args&&...))
150 (allocate_shared): Change to use new tag type.
151 * include/bits/shared_ptr_base.h (_Sp_make_shared_tag::_S_eq):
152 Declare new member function.
153 (_Sp_alloc_shared_tag): Define new type.
154 (_Sp_counted_ptr_inplace): Declare __shared_count<_Lp> as a friend.
155 (_Sp_counted_ptr_inplace::_M_get_deleter) [!__cpp_rtti]: Use
156 _Sp_make_shared_tag::_S_eq to check type_info.
157 (__shared_count(Ptr, Deleter),__shared_count(Ptr, Deleter, Alloc)):
158 Constrain to prevent being called with _Sp_alloc_shared_tag.
159 (__shared_count(_Sp_make_shared_tag, const _Alloc&, Args&&...)):
160 Replace constructor with ...
161 (__shared_count(Tp*&, _Sp_alloc_shared_tag<_Alloc>, Args&&...)): Use
162 reference parameter so address of the new object can be returned to
163 the caller. Obtain the allocator from the tag type.
164 (__shared_ptr(_Sp_make_shared_tag, const Alloc&, Args&&...)): Replace
165 constructor with ...
166 (__shared_ptr(_Sp_alloc_shared_tag<Alloc>, Args&&...)): Pass _M_ptr
167 to the __shared_count constructor.
168 (__allocate_shared): Change to use new tag type.
169 * src/c++11/shared_ptr.cc (_Sp_make_shared_tag::_S_eq): Define.
170
171 2019-01-17 Jonathan Wakely <jwakely@redhat.com>
172
173 * src/c++17/fs_ops.cc
174 (equivalent(const path&, const path&, error_code&))
175 [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Use GetFileInformationByHandle to
176 compare files instead of relying on incomplete info returned by stat.
177
178 PR libstdc++/88884
179 * src/c++17/fs_ops.cc (absolute(const path&, error_code&)): Do nothing
180 if the path is already absolute.
181 [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Normalize root-directory.
182 [!_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Pass error_code to current_path.
183
184 PR libstdc++/88881
185 * src/c++17/fs_ops.cc (canonical(const path&, error_code&))
186 [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Normalize path, to match behaviour
187 of filesystem::exists.
188 (create_directories(const path&, error_code&)): Add assertions.
189 (status(const path&, error_code&)) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]:
190 Add workaround for bug in _wstat for paths with trailing slash.
191 * testsuite/27_io/filesystem/operations/create_directories.cc: Adjust
192 for expected behaviour on mingw.
193 * testsuite/experimental/filesystem/operations/create_directories.cc:
194 Likewise.
195 * testsuite/27_io/filesystem/operations/temp_directory_path.cc: Use
196 "TMP" instead of "TMPDIR" and clean environment before each test. Do
197 not test permissions on mingw targets.
198
199 2019-01-16 Jonathan Wakely <jwakely@redhat.com>
200
201 * config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Add exports for fstream
202 constructors and open members taking wide strings. Fix patterns for
203 filesystem::path members to match wstring_view parameters. Add
204 exports for shared_ptr members used by directory iterators.
205 * src/c++17/fs_ops.cc (remove(const path&, error_code&)): Clear the
206 error code parameter if the file doesn't exist.
207 * src/filesystem/ops.cc (remove(const path&, error_code&)):
208 Likewise.
209 * testsuite/27_io/filesystem/operations/canonical.cc: Fix expected
210 values for mingw targets, where "/" is not an absolute path. Do not
211 test symlinks on mingw targets.
212 * testsuite/experimental/filesystem/operations/canonical.cc: Likewise.
213 * testsuite/27_io/filesystem/operations/copy.cc: Do not test symlinks
214 on mingw targets.
215 * testsuite/experimental/filesystem/operations/copy.cc: Likewise.
216 * testsuite/27_io/filesystem/operations/create_directories.cc: Check
217 that each component of the path is created.
218 * testsuite/experimental/filesystem/operations/create_directories.cc:
219 Likewise.
220 * testsuite/27_io/filesystem/operations/exists.cc: Do not test
221 permissions on mingw targets.
222 * testsuite/experimental/filesystem/operations/exists.cc: Likewise.
223 * testsuite/27_io/filesystem/operations/is_empty.cc: Likewise.
224 * testsuite/experimental/filesystem/operations/is_empty.cc: Likewise.
225 * testsuite/27_io/filesystem/operations/permissions.cc: XFAIL for
226 mingw targets.
227 * testsuite/experimental/filesystem/operations/permissions.cc:
228 Likewise.
229 * testsuite/27_io/filesystem/operations/remove.cc: Do not test
230 symlinks or permissions on mingw targets.
231 * testsuite/experimental/filesystem/operations/remove.cc: Likewise.
232 * testsuite/27_io/filesystem/operations/remove_all.cc: Do not test
233 symlinks on mingw targets.
234 * testsuite/experimental/filesystem/operations/remove_all.cc:
235 Likewise.
236 * testsuite/27_io/filesystem/operations/status.cc: Do not test
237 permissions on mingw targets.
238 * testsuite/27_io/filesystem/operations/weakly_canonical.cc: Do not
239 test symlinks on mingw targets.
240 * testsuite/experimental/filesystem/operations/space.cc: Fix test
241 for mingw targets.
242
243 2019-02-14 Ulrich Drepper <drepper@redhat.com>
244
245 PR libstdc++/88738
246 Warn about unused comparisons of shared_ptr/unique_ptr
247 * include/bits/c++config [_GLIBCXX_NODISCARD]: Define.
248 * include/bits/shared_ptr.h: Use it for operator ==, !=,
249 <, <=, >, >= for shared_ptr.
250 * include/bits/unique_ptr.h: Likewise for unique_ptr.
251
252 2019-01-15 Jonathan Wakely <jwakely@redhat.com>
253
254 * include/bits/shared_ptr_base.h (__cpp_lib_shared_ptr_arrays): Define
255 as 201611L, because P0497R0 changes are supported.
256 * include/std/version (__cpp_lib_shared_ptr_arrays): Likewise.
257
258 * include/bits/erase_if.h [__cplusplus > 201703L]
259 (__cpp_lib_erase_if): Only define for C++2a.
260 * include/std/iterator [__cplusplus >= 201402L && !_GLIBCXX_DEBUG]
261 (__cpp_lib_null_iterators): Define.
262 * include/std/version [__cplusplus >= 201402L && !_GLIBCXX_DEBUG]
263 (__cpp_lib_null_iterators): Define.
264 [__cpp_impl_destroying_delete] (__cpp_lib_destroying_delete): Define.
265
266 * doc/xml/manual/status_cxx2017.xml: Document P0032R3 and P0307R2
267 status.
268 * include/bits/stl_uninitialized.h (__cpp_lib_raw_memory_algorithms):
269 Define.
270 * include/std/any (__cpp_lib_any): Define as 201606L, because P0032R3
271 changes are supported.
272 * include/std/optional (__cpp_lib_optional): Likewise.
273 * include/std/variant (__cpp_lib_variant): Likewise.
274 * include/std/version [!__STRICT_ANSI__]
275 (__cpp_lib_uncaught_exceptions): Define as long integer.
276 [__cplusplus >= 201703L] (__cpp_lib_any)
277 (__cpp_lib_raw_memory_algorithms, __cpp_lib_uncaught_exceptions)
278 (__cpp_lib_variant): Define for C++17.
279 [__cplusplus >= 201703L] (__cpp_lib_optional): Update value and define
280 as long integer.
281 * libsupc++/exception (__cpp_lib_uncaught_exceptions): Define as long
282 integer.
283
284 * doc/xml/manual/status_cxx2020.xml: Update P1123R0 status.
285
286 2019-01-12 Jonathan Wakely <jwakely@redhat.com>
287
288 PR libstdc++/88811
289 PR libstdc++/83306
290 * src/filesystem/path.cc: Fix typo. If first path is empty, show []
291 before second path.
292 * testsuite/experimental/filesystem/filesystem_error/cons.cc: New
293 test.
294
295 2019-01-11 Jonathan Wakely <jwakely@redhat.com>
296
297 * doc/xml/manual/intro.xml: Include new section.
298 * doc/xml/manual/status_cxx2017.xml: Document more
299 implementation-defined properties of the library.
300 * doc/xml/manual/status_cxx2020.xml: Document C++2a status.
301 * doc/html/*: Regenerate.
302
303 * include/bits/refwrap.h [__cplusplus > 201703L]
304 (_Refwrap_base_arg1, _Refwrap_base_arg2, _Reference_wrapper_base)
305 (_Reference_wrapper_base_memfun): Do not define for C++2a.
306 (reference_wrapper): Do not derive from _Reference_wrapper_base_memfun
307 for C++2a.
308 (reference_wrapper::operator()): Add static assertion.
309 * testsuite/20_util/reference_wrapper/incomplete.cc: New test.
310
311 * include/std/chrono (duration_values::zero(), duration_values::min())
312 (duration_values::max()): Add noexcept.
313 (duration::zero(), duration::min(), duration::max()): Likewise.
314 (time_point::zero(), time_point::min(), time_point::max()): Likewise.
315 * testsuite/20_util/duration/requirements/noexcept.cc: New test.
316 * testsuite/20_util/time_point/requirements/noexcept.cc: New test.
317
318 * include/std/version (__cpp_lib_erase_if): Move to C++20 group.
319
320 2019-01-11 Jakub Jelinek <jakub@redhat.com>
321
322 * include/std/type_traits (__cpp_lib_is_constant_evaluated): Define.
323 * include/std/version (__cpp_lib_is_constant_evaluated): Define.
324
325 2019-01-11 Jonathan Wakely <jwakely@redhat.com>
326
327 PR libstdc++/88802
328 * include/bits/functional_hash.h (hash<nullptr_t>): Define
329 specialization for C++17 (P0513R0, LWG 2817).
330 * testsuite/20_util/hash/nullptr.cc: New test.
331
332 PR libstdc++/88125
333 * config/abi/pre/gnu.ver (GLIBCXX_3.4.6): Remove unused duplicate
334 pattern for std::basic_stringbuf::str().
335
336 * config/abi/pre/gnu.ver (GLIBCXX_3.4): Correct recent changes to
337 basic_ostream::operator<< patterns.
338
339 2019-01-10 Jonathan Wakely <jwakely@redhat.com>
340
341 * testsuite/27_io/filesystem/operations/last_write_time.cc: Fix
342 test failures on targets with 32-bit time_t.
343
344 * include/bits/erase_if.h: Define __cpp_lib_erase_if.
345 * include/std/deque: Likewise.
346 * include/std/forward_list: Likewise.
347 * include/std/list: Likewise.
348 * include/std/string: Likewise.
349 * include/std/vector: Likewise.
350 * include/std/version: Likewise.
351 * testsuite/21_strings/basic_string/erasure.cc: Test macro.
352 * testsuite/23_containers/deque/erasure.cc: Likewise.
353 * testsuite/23_containers/forward_list/erasure.cc: Likewise.
354 * testsuite/23_containers/list/erasure.cc: Likewise.
355 * testsuite/23_containers/map/erasure.cc: Likewise.
356 * testsuite/23_containers/set/erasure.cc: Likewise.
357 * testsuite/23_containers/unordered_map/erasure.cc: Likewise.
358 * testsuite/23_containers/unordered_set/erasure.cc: Likewise.
359 * testsuite/23_containers/vector/erasure.cc: Likewise.
360
361 * include/experimental/internet [AI_NUMERICSERV]
362 (resolver_base::numeric_service): Define conditionally.
363 * testsuite/experimental/net/internet/resolver/base.cc: Test it
364 conditionally.
365 * testsuite/experimental/net/internet/resolver/ops/lookup.cc:
366 Likewise.
367
368 2019-01-10 Ville Voutilainen <ville.voutilainen@gmail.com>
369 Jonathan Wakely <jwakely@redhat.com>
370
371 Implement LWG 2221
372 * config/abi/pre/gnu.ver (GLIBCXX_3.4): Tighten patterns.
373 (GLIBCXX_3.4.26): Add new exports.
374 * include/Makefile.am: Add ostream-inst.cc. Move string-inst.cc to
375 correct list of sources.
376 * include/Makefile.in: Regenerate.
377 * include/std/ostream (operator<<(nullptr_t)): New member function.
378 * src/c++17/ostream-inst.cc: New file.
379 * testsuite/27_io/basic_ostream/inserters_other/char/lwg2221.cc: New
380 test.
381
382 2019-01-10 Jonathan Wakely <jwakely@redhat.com>
383
384 * testsuite/util/testsuite_fs.h (nonexistent_path): Include name
385 of the source file containing the caller.
386 * testsuite/27_io/filesystem/iterators/directory_iterator.cc: Remove
387 directories created by test.
388 * testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
389 Likewise.
390 * testsuite/experimental/filesystem/iterators/directory_iterator.cc:
391 Likewise.
392 * testsuite/experimental/filesystem/iterators/
393 recursive_directory_iterator.cc: Likewise.
394
395 2019-01-10 Jakub Jelinek <jakub@redhat.com>
396
397 PR tree-optimization/88775
398 * include/bits/stl_function.h (greater<_Tp*>::operator(),
399 less<_Tp*>::operator(), greater_equal<_Tp*>::operator(),
400 less_equal<_Tp*>::operator()): Use __builtin_is_constant_evaluated
401 instead of __builtin_constant_p if available. Don't bother with
402 the pointer comparison in C++11 and earlier.
403
404 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
405
406 PR other/16615
407
408 * include/ext/bitmap_allocator.h: Mechanically replace "can not"
409 with "cannot".
410
411 2019-01-09 Jonathan Wakely <jwakely@redhat.com>
412
413 * testsuite/libstdc++-prettyprinters/cxx17.cc: Fix expected output
414 for filesystem::path. Give variables more distinctive names.
415
416 * include/std/optional (_Optional_payload_base::_M_copy_assign): New
417 member function to perform non-trivial assignment.
418 (_Optional_payload_base::_M_move_assign): Likewise.
419 (_Optional_payload<T, true, false, true>::operator=)
420 (_Optional_payload<T, true, true, false>::operator=)
421 (_Optional_payload<T, true, false, false>::operator=): Call
422 _M_copy_assign and/or _M_move_assign to do non-trivial assignments.
423
424 PR libstdc++/88204
425 * testsuite/26_numerics/complex/operators/more_constexpr.cc: Do not
426 test std::complex<long double> if long double format is IBM128.
427 * testsuite/26_numerics/complex/requirements/more_constexpr.cc:
428 Likewise.
429
430 2019-01-08 Jonathan Wakely <jwakely@redhat.com>
431
432 * testsuite/libstdc++-prettyprinters/compat.cc: Test printer support
433 for old std::unique_ptr layout.
434 * testsuite/libstdc++-prettyprinters/cxx17.cc: Fix std::variant test
435 to become valueless. Add filesystem::path tests.
436
437 PR libstdc++/87855
438 * include/std/optional (_Optional_payload_base): New class template
439 for common code hoisted from _Optional_payload specializations. Use
440 a template for the union, to allow a partial specialization for
441 types with non-trivial destructors. Add constructors for in-place
442 initialization to the union.
443 (_Optional_payload(bool, const _Optional_payload&)): Use _M_construct
444 to perform non-trivial copy construction, instead of relying on
445 non-standard copy elision in a delegating constructor.
446 (_Optional_payload(bool, _Optional_payload&&)): Likewise for
447 non-trivial move construction.
448 (_Optional_payload): Derive from _Optional_payload_base and use it
449 for everything except the non-trivial assignment operators, which are
450 defined as needed.
451 (_Optional_payload<false, C, M>): Derive from the specialization
452 _Optional_payload<true, false, false> and add a destructor.
453 (_Optional_base_impl::_M_destruct, _Optional_base_impl::_M_reset):
454 Forward to corresponding members of _Optional_payload.
455 (_Optional_base_impl::_M_is_engaged, _Optional_base_impl::_M_get):
456 Hoist common members from _Optional_base.
457 (_Optional_base): Make all members and base class public.
458 (_Optional_base::_M_get, _Optional_base::_M_is_engaged): Move to
459 _Optional_base_impl.
460 * python/libstdcxx/v6/printers.py (StdExpOptionalPrinter): Add
461 support for new std::optional layout.
462 * testsuite/libstdc++-prettyprinters/compat.cc: New test.
463
464 PR libstdc++/88066
465 * include/bits/locale_conv.h: Use <> for includes not "".
466 * include/ext/random: Likewise.
467 * include/ext/vstring.h: Likewise.
468
469 2019-01-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
470
471 * config/abi/pre/gnu.ver (GLIBCXX_3.4): Tighten existing patterns.
472 (GLIBCXX_3.4.21): Likewise.
473
474 2019-01-08 Jonathan Wakely <jwakely@redhat.com>
475
476 PR libstdc++/88749
477 * src/filesystem/ops.cc (last_write_time): Fix preprocessor condition
478 to match the one that controls whether utimbuf and utime are declared.
479
480 2019-01-07 Jonathan Wakely <jwakely@redhat.com>
481
482 PR libstdc++/87787
483 * include/bits/char_traits.h (char_traits::move): Do not pass null
484 pointers to memmove.
485 * include/bits/locale_facets.h
486 (ctype<char>::widen(const char*, const char*, char*)): Do not
487 pass null pointers to memcpy.
488 (ctype<char>::narrow(const char*, const char*, char, char*)):
489 Likewise.
490 (ctype<char>::do_widen(const char*, const char*, char*)):
491 Likewise.
492 (ctype<char>::do_narrow(const char*, const char*, char, char*)):
493 Likewise.
494
495 * doc/xml/manual/spine.xml: Update copyright years.
496 * doc/xml/manual/status_cxx2017.xml: Adjust note about -lstdc++fs.
497 * doc/xml/manual/using.xml: Remove requirement to link with -lstdc++fs
498 for C++17 filesystem library.
499 * doc/html/*: Regenerate.
500
501 * acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for truncate.
502 * config.h.in: Regenerate.
503 * config/abi/pre/gnu.ver: Order patterns for filesystem operations
504 alphabetically and add missing entries for copy_symlink,
505 hard_link_count, rename, and resize_file.
506 * configure: Regenerate.
507 * src/c++17/fs_ops.cc (resize_file): Remove #if so posix::truncate is
508 used unconditionally.
509 * src/filesystem/ops-common.h (__gnu_posix::truncate)
510 [!_GLIBCXX_HAVE_TRUNCATE]: Provide fallback definition that only
511 supports truncating to zero length.
512 * testsuite/27_io/filesystem/operations/all.cc: New test.
513 * testsuite/27_io/filesystem/operations/resize_file.cc: New test.
514
515 2019-01-06 Jonathan Wakely <jwakely@redhat.com>
516
517 PR libstdc++/86756
518 * acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for utime and
519 lstat and define _GLIBCXX_USE_UTIME and _GLIBCXX_USE_LSTAT.
520 * config.h.in: Regenerate.
521 * config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Export symbols for
522 remaining std::filesystem types and functions.
523 * configure: Regenerate.
524 * src/c++17/Makefile.am: Add C++17 filesystem sources.
525 * src/c++17/Makefile.in: Regenerate.
526 * src/c++17/cow-fs_dir.cc: Move src/filesystem/cow-std-dir.cc to
527 here, and change name of included file.
528 * src/c++17/cow-fs_ops.cc: Move src/filesystem/cow-std-ops.cc to
529 here, and change name of included file.
530 * src/c++17/fs_dir.cc: Move src/filesystem/std-dir.cc to here. Change
531 path to dir-common.h.
532 * src/c++17/fs_ops.cc: Move src/filesystem/std-ops.cc to here. Change
533 path to ops-common.h. Disable -Wunused-parameter warnings.
534 (internal_file_clock): Define unconditionally.
535 [!_GLIBCXX_HAVE_SYS_STAT_H] (internal_file_clock::from_stat): Do not
536 define.
537 (do_copy_file, do_space): Move definitions to ops.common.h.
538 (copy, file_size, hard_link_count, last_write_time, space): Only
539 perform operation when _GLIBCXX_HAVE_SYS_STAT_H is defined, otherwise
540 report an error.
541 (last_write_time, read_symlink): Remove unused attributes from
542 parameters.
543 * src/filesystem/Makefile.am: Remove C++17 filesystem sources.
544 * src/filesystem/Makefile.in: Regenerate.
545 * src/filesystem/cow-std-dir.cc: Move to src/c++17/cow-fs_dir.cc.
546 * src/filesystem/cow-std-ops.cc: Move to src/c++17/cow-fs_ops.cc.
547 * src/filesystem/std-dir.cc: Move to src/c++17/fs_dir.cc.
548 * src/filesystem/std-ops.cc: Move to src/c++17/fs_ops.cc.
549 * src/filesystem/dir-common.h [!_GLIBCXX_HAVE_DIRENT_H]: Define
550 dummy types and functions instead of using #error.
551 * src/filesystem/dir.cc [!_GLIBCXX_HAVE_DIRENT_H]: Use #error.
552 * src/filesystem/ops-common.h [!_GLIBCXX_USE_LSTAT] (lstat): Define
553 in terms of stat.
554 [!_GLIBCXX_HAVE_UNISTD_H]: Define dummy types and functions.
555 (do_copy_file, do_space): Move definitions here from std-ops.cc.
556 * src/filesystem/ops.cc: Adjust calls to do_copy_file and do_space
557 to account for new namespace.
558 * testsuite/27_io/filesystem/directory_entry/86597.cc: Remove
559 -lstdc++fs from dg-options.
560 * testsuite/27_io/filesystem/directory_entry/lwg3171.cc: Likewise.
561 * testsuite/27_io/filesystem/file_status/1.cc: Likewise.
562 * testsuite/27_io/filesystem/filesystem_error/cons.cc: Likewise.
563 * testsuite/27_io/filesystem/filesystem_error/copy.cc: Likewise.
564 * testsuite/27_io/filesystem/iterators/directory_iterator.cc:
565 Likewise.
566 * testsuite/27_io/filesystem/iterators/pop.cc: Likewise.
567 * testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
568 Likewise.
569 * testsuite/27_io/filesystem/operations/absolute.cc: Likewise.
570 * testsuite/27_io/filesystem/operations/canonical.cc: Likewise.
571 * testsuite/27_io/filesystem/operations/copy.cc: Likewise.
572 * testsuite/27_io/filesystem/operations/copy_file.cc: Likewise.
573 * testsuite/27_io/filesystem/operations/create_directories.cc:
574 Likewise.
575 * testsuite/27_io/filesystem/operations/create_directory.cc: Likewise.
576 * testsuite/27_io/filesystem/operations/create_symlink.cc: Likewise.
577 * testsuite/27_io/filesystem/operations/current_path.cc: Likewise.
578 * testsuite/27_io/filesystem/operations/equivalent.cc: Likewise.
579 * testsuite/27_io/filesystem/operations/exists.cc: Likewise.
580 * testsuite/27_io/filesystem/operations/file_size.cc: Likewise.
581 * testsuite/27_io/filesystem/operations/is_empty.cc: Likewise.
582 * testsuite/27_io/filesystem/operations/last_write_time.cc: Likewise.
583 * testsuite/27_io/filesystem/operations/permissions.cc: Likewise.
584 * testsuite/27_io/filesystem/operations/proximate.cc: Likewise.
585 * testsuite/27_io/filesystem/operations/read_symlink.cc: Likewise.
586 * testsuite/27_io/filesystem/operations/relative.cc: Likewise.
587 * testsuite/27_io/filesystem/operations/remove.cc: Likewise.
588 * testsuite/27_io/filesystem/operations/remove_all.cc: Likewise.
589 * testsuite/27_io/filesystem/operations/space.cc: Likewise.
590 * testsuite/27_io/filesystem/operations/status.cc: Likewise.
591 * testsuite/27_io/filesystem/operations/symlink_status.cc: Likewise.
592 * testsuite/27_io/filesystem/operations/temp_directory_path.cc:
593 Likewise.
594 * testsuite/27_io/filesystem/operations/weakly_canonical.cc: Likewise.
595
596
597 PR libstdc++/86756
598 * config/abi/pre/gnu.ver (GLIBCXX_3.4): Make various patterns for
599 typeinfo and vtables less greedy.
600 (GLIBCXX_3.4.26): Export symbols for std::filesystem::path.
601 * src/c++17/Makefile.am: Add fs_path.cc and cow-fs_path.cc.
602 * src/c++17/Makefile.in: Regenerate.
603 * src/c++17/cow-fs_path.cc: Move src/filesystem/cow-std-path.cc to
604 here, and change name of included file.
605 * src/c++17/fs_path.cc: Move src/filesystem/std-path.cc to here.
606 * src/filesystem/Makefile.am: Remove std-path.cc and cow-std-path.cc
607 from sources.
608 * src/filesystem/Makefile.in: Regenerate.
609 * src/filesystem/cow-std-path.cc: Move to src/c++17/cow-fs_path.cc.
610 * src/filesystem/std-path.cc: Move to src/c++17/fs_path.cc.
611 * testsuite/27_io/filesystem/path/append/path.cc: Remove -lstdc++fs
612 from dg-options and remove dg-require-filesystem-ts.
613 * testsuite/27_io/filesystem/path/append/source.cc: Likewise.
614 * testsuite/27_io/filesystem/path/assign/assign.cc: Likewise.
615 * testsuite/27_io/filesystem/path/assign/copy.cc: Likewise.
616 * testsuite/27_io/filesystem/path/compare/compare.cc: Likewise.
617 * testsuite/27_io/filesystem/path/compare/lwg2936.cc: Likewise.
618 * testsuite/27_io/filesystem/path/compare/path.cc: Likewise.
619 * testsuite/27_io/filesystem/path/compare/strings.cc: Likewise.
620 * testsuite/27_io/filesystem/path/concat/path.cc: Likewise.
621 * testsuite/27_io/filesystem/path/concat/strings.cc: Likewise.
622 * testsuite/27_io/filesystem/path/construct/80762.cc: Likewise.
623 * testsuite/27_io/filesystem/path/construct/copy.cc: Likewise.
624 * testsuite/27_io/filesystem/path/construct/default.cc: Likewise.
625 * testsuite/27_io/filesystem/path/construct/format.cc: Likewise.
626 * testsuite/27_io/filesystem/path/construct/locale.cc: Likewise.
627 * testsuite/27_io/filesystem/path/construct/range.cc: Likewise.
628 * testsuite/27_io/filesystem/path/construct/string_view.cc: Likewise.
629 * testsuite/27_io/filesystem/path/decompose/extension.cc: Likewise.
630 * testsuite/27_io/filesystem/path/decompose/filename.cc: Likewise.
631 * testsuite/27_io/filesystem/path/decompose/parent_path.cc: Likewise.
632 * testsuite/27_io/filesystem/path/decompose/relative_path.cc: Likewise.
633 * testsuite/27_io/filesystem/path/decompose/root_directory.cc:
634 Likewise.
635 * testsuite/27_io/filesystem/path/decompose/root_name.cc: Likewise.
636 * testsuite/27_io/filesystem/path/decompose/root_path.cc: Likewise.
637 * testsuite/27_io/filesystem/path/decompose/stem.cc: Likewise.
638 * testsuite/27_io/filesystem/path/generation/normal.cc: Likewise.
639 * testsuite/27_io/filesystem/path/generation/normal2.cc: Likewise.
640 * testsuite/27_io/filesystem/path/generation/proximate.cc: Likewise.
641 * testsuite/27_io/filesystem/path/generation/relative.cc: Likewise.
642 * testsuite/27_io/filesystem/path/generic/generic_string.cc: Likewise.
643 * testsuite/27_io/filesystem/path/itr/components.cc: Likewise.
644 * testsuite/27_io/filesystem/path/itr/traversal.cc: Likewise.
645 * testsuite/27_io/filesystem/path/modifiers/clear.cc: Likewise.
646 * testsuite/27_io/filesystem/path/modifiers/make_preferred.cc:
647 Likewise.
648 * testsuite/27_io/filesystem/path/modifiers/remove_filename.cc:
649 Likewise.
650 * testsuite/27_io/filesystem/path/modifiers/replace_extension.cc:
651 Likewise.
652 * testsuite/27_io/filesystem/path/modifiers/replace_filename.cc:
653 Likewise.
654 * testsuite/27_io/filesystem/path/modifiers/swap.cc: Likewise.
655 * testsuite/27_io/filesystem/path/native/string.cc: Likewise.
656 * testsuite/27_io/filesystem/path/nonmember/append.cc: Likewise.
657 * testsuite/27_io/filesystem/path/nonmember/hash_value.cc: Likewise.
658 * testsuite/27_io/filesystem/path/query/empty.cc: Likewise.
659 * testsuite/27_io/filesystem/path/query/has_extension.cc: Likewise.
660 * testsuite/27_io/filesystem/path/query/has_filename.cc: Likewise.
661 * testsuite/27_io/filesystem/path/query/has_parent_path.cc: Likewise.
662 * testsuite/27_io/filesystem/path/query/has_relative_path.cc: Likewise.
663 * testsuite/27_io/filesystem/path/query/has_root_directory.cc:
664 Likewise.
665 * testsuite/27_io/filesystem/path/query/has_root_name.cc: Likewise.
666 * testsuite/27_io/filesystem/path/query/has_root_path.cc: Likewise.
667 * testsuite/27_io/filesystem/path/query/has_stem.cc: Likewise.
668 * testsuite/27_io/filesystem/path/query/is_absolute.cc: Likewise.
669 * testsuite/27_io/filesystem/path/query/is_relative.cc: Likewise.
670
671 PR libstdc++/87431
672 * include/std/variant (_Variant_storage<true, _Types...>::_M_valid):
673 Check is_trivially_copyable instead of is_scalar.
674 (variant::emplace<N, Args>(Args&&...)): If construction of the new
675 contained value can throw and its type is trivially copyable then
676 construct into a temporary variant and move from it, to provide the
677 strong exception safety guarantee.
678 (variant::emplace<N, U, Args>(initializer_list<U>, Args&&...)):
679 Likewise.
680 * testsuite/20_util/variant/87431.cc: New test.
681 * testsuite/20_util/variant/run.cc: Adjust test so that throwing
682 conversion causes valueless state.
683
684 PR libstdc++/88607
685 * testsuite/17_intro/headers/c++1998/charset.cc: New test.
686 * testsuite/17_intro/headers/c++2011/charset.cc: New test.
687 * testsuite/17_intro/headers/c++2014/charset.cc: New test.
688 * testsuite/17_intro/headers/c++2017/charset.cc: New test.
689 * testsuite/17_intro/headers/c++2020/charset.cc: New test.
690
691 2019-01-05 Jonathan Wakely <jwakely@redhat.com>
692
693 * include/bits/fs_fwd.h (__file_clock): Define new clock.
694 (file_time_type): Redefine in terms of __file_clock.
695 * src/filesystem/ops-common.h (file_time): Add FIXME comment about
696 overflow.
697 * src/filesystem/std-ops.cc (is_set(perm_options, perm_options)): Give
698 internal linkage.
699 (internal_file_lock): New helper type for accessing __file_clock.
700 (do_copy_file): Use internal_file_lock to convert system time to
701 file_time_type.
702 (last_write_time(const path&, error_code&)): Likewise.
703 (last_write_time(const path&, file_time_type, error_code&)): Likewise.
704
705 2019-01-04 Jonathan Wakely <jwakely@redhat.com>
706
707 * config/abi/pre/gnu.ver (GLIBCXX_3.4.21): Make patterns less greedy
708 for const member functions of std::basic_string.
709 (GLIBCXX_3.4.26): Export member functions of std::basic_string added
710 in C++17.
711 * include/bits/basic_string.h (basic_string(__sv_wrapper, const A&)):
712 Make non-standard constructor private.
713 [!_GLIBCXX_USE_CXX11_ABI] (basic_string(__sv_wrapper, const A&)):
714 Likewise.
715 * include/bits/basic_string.tcc (std::string, std::wstring): Declare
716 explicit instantiations for C++17 as well as earlier dialects.
717 * src/c++17/Makefile.am: Add new source files.
718 * src/c++17/Makefile.in: Regenerate.
719 * src/c++17/cow-string-inst.cc: New file defining explicit
720 instantiations for basic_string member functions added in C++17.
721 * src/c++17/string-inst.cc: Likewise.
722
723 * config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Export allocator-extended
724 copy/move constructors for old std::basic_string.
725 * include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
726 (basic_string::reference, basic_string::const_reference): Define
727 as plain references for C++11 and later.
728 (basic_string::basic_string()): Put constructor body outside
729 preprocessor conditional groups.
730 (basic_string::basic_string(basic_string&&)): Move _Alloc_hider
731 instead of copying it.
732 (basic_string::basic_string(const basic_string&, const _Alloc&)):
733 Define.
734 (basic_string::basic_string(basic_string&&, const _Alloc&)):
735 Define.
736 * include/bits/fs_path.h [!_GLIBCXX_USE_CXX11_ABI]: Remove special
737 cases for old basic_string.
738 * testsuite/21_strings/basic_string/cons/char/8.cc: Test
739 allocator-extended constructors unconditionally. Add extra members to
740 allocator type when using old string ABI.
741 * testsuite/21_strings/basic_string/allocator/71964.cc: Enable test
742 for old string ABI.
743 * testsuite/21_strings/basic_string/cons/wchar_t/8.cc: Likewise.
744
745 * testsuite/23_containers/list/61347.cc: Avoid spurious failure when
746 -fno-inline added to test flags.
747
748 * testsuite/21_strings/basic_string/requirements/
749 explicit_instantiation/debug.cc: Remove XFAIL for old ABI.
750
751 * testsuite/27_io/filesystem/filesystem_error/copy.cc: Fix static
752 assertion failures with old std::string ABI.
753
754 * include/bits/fs_path.h (path::_List::erase): Replace both overloads
755 with ...
756 (path::pop_back(), path::_M_erase_from(const_iterator)): New member
757 functions that will only erase elements at the end.
758 * src/filesystem/std-path.cc (path::_List::_Impl::pop_back()): Define.
759 (path::_List::_Impl::_M_erase_from(const_iterator)): Define.
760 (path::_List::operator=(const _List&)): Use _M_erase_from(p) instead
761 of erase(p, end()).
762 (path::_List::pop_back()): Define.
763 (path::_List::_M_erase_from(const_iterator)): Define.
764 (path::operator/=(const path&)): Use pop_back to remove last component
765 and _M_erase_from to remove multiple components.
766 (path::_M_append(basic_string_view<value_type>)): Likewise.
767 (path::operator+=(const path&)): Likewise.
768 (path::_M_concat(basic_string_view<value_type>)): Likewise.
769 (path::remove_filename()): Likewise.
770 (path::lexically_normal()): Use _List::_Impl iterators instead of
771 path::iterator. Use pop_back to remove components from the end. Clear
772 trailing filename, instead of using erase(const_iterator) to remove
773 a non-final component.
774 * testsuite/27_io/filesystem/path/generation/normal.cc: Test
775 additional cases.
776 * testsuite/27_io/filesystem/path/generation/normal2.cc: New test.
777
778 * src/filesystem/std-path.cc (path::operator+=(const path&)): Fix
779 incorrect treatment of empty filename after trailing slash.
780 * testsuite/27_io/filesystem/path/concat/path.cc: Test problem case.
781
782 * testsuite/21_strings/basic_string/modifiers/assign/char/
783 move_assign_optim.cc: Avoid spurious failure when -fno-inline added
784 to test flags.
785 * testsuite/21_strings/basic_string/modifiers/assign/wchar_t/
786 move_assign_optim.cc: Likewise.
787
788 2019-01-03 Jonathan Wakely <jwakely@redhat.com>
789 Jakub Jelinek <jakub@redhat.com>
790
791 PR libstdc++/88607
792 * include/experimental/memory: Replace UTF-8 quote characters.
793 * include/std/future: Replace UTF-8 "em dash" characters.
794
795 2019-01-03 Jonathan Wakely <jwakely@redhat.com>
796
797 PR libstdc++/88607
798 * include/bits/forward_list.h: Replace UTF-8 "ligature fi" character.
799 * include/debug/forward_list: Likewise.
800 * include/experimental/bits/shared_ptr.h: Remove UTF-8 "section sign"
801 character.
802 * include/experimental/chrono: Likewise.
803 * include/experimental/functional: Likewise.
804 * include/experimental/ratio: Likewise.
805 * include/experimental/system_error: Likewise.
806 * include/experimental/tuple: Likewise.
807 * include/experimental/type_traits: Likewise.
808 * include/parallel/workstealing.h: Replace UTF-8 "en dash" character.
809 * include/parallel/multiseq_selection.h: Likewise.
810
811 PR libstdc++/88681
812 * config/abi/pre/gnu.ver: Add missing exports.
813 * testsuite/22_locale/collate_byname/88681.cc: New test.
814 * testsuite/22_locale/time_get/get/char/88681.cc: New test.
815 * testsuite/22_locale/time_get/get/wchar_t/88681.cc: New test.
816
817 2019-01-02 Jonathan Wakely <jwakely@redhat.com>
818
819 * testsuite/23_containers/map/cons/deduction.cc: Test deduction from
820 initializer_list<value_type> and from input iterator ranges.
821 * testsuite/23_containers/multimap/cons/deduction.cc: Likewise.
822
823 * testsuite/experimental/string_view/element_access/char/empty.cc:
824 Fix year range in copyright header.
825
826 2019-01-02 Joel Brobecker <brobecker@adacore.com>
827
828 * testsuite/21_strings/basic_string_view/element_access/char/empty.cc:
829 Fix year range in copyright header.
830
831 2019-01-01 Jakub Jelinek <jakub@redhat.com>
832
833 Update copyright years.
834 \f
835 Copyright (C) 2019 Free Software Foundation, Inc.
836
837 Copying and distribution of this file, with or without modification,
838 are permitted in any medium without royalty provided the copyright
839 notice and this notice are preserved.