Jonathan Wakely
a1e1ec7605
Fix std::codecvt_utf8* for big-endian targets
...
PR libstdc++/69703
* src/c++11/codecvt.cc (__codecvt_utf8_base<char16_t>::do_in,
__codecvt_utf8_utf16_base<char16_t>::do_in): Fix mask operations.
From-SVN: r235293
2016-04-20 18:40:02 +01:00
Jonathan Wakely
29ca91f72e
libstdc++/69703 ignore endianness in codecvt_utf8
...
PR libstdc++/69703
* src/c++11/codecvt.cc (__codecvt_utf8_base<char16_t>::do_in)):
Override endianness bit in mode.
* testsuite/22_locale/codecvt/codecvt_utf8/69703.cc: New test.
* testsuite/22_locale/codecvt/codecvt_utf8_utf16/66855.cc: Test
that little_endian mode is ignored.
* testsuite/experimental/filesystem/path/native/string.cc: New test.
From-SVN: r235216
2016-04-19 19:02:46 +01:00
Jonathan Wakely
1490525104
libstdc++/70609 fix filesystem::copy()
...
PR libstdc++/70609
* src/filesystem/ops.cc (close_fd): New function.
(do_copy_file): Set permissions before copying file contents. Check
result of closing file descriptors. Don't copy streambuf when file
is empty.
(copy(const path&, const path&, copy_options, error_code&)): Use
lstat for source file when copy_symlinks is set.
* testsuite/experimental/filesystem/operations/copy.cc: Test copy().
From-SVN: r235215
2016-04-19 19:02:39 +01:00
Jonathan Wakely
9c476ad426
Add noexcept to Filesystem TS operators
...
* include/experimental/bits/fs_fwd.h (operator&, operator|, operator^,
operator~ operator&=, operator|=, operator^=): Add noexcept to
overloaded operators for copy_options, perms and directory_options.
* src/filesystem/ops.cc (make_file_type, make_file_status,
is_not_found_errno, file_time): Add noexcept.
From-SVN: r235214
2016-04-19 19:02:32 +01:00
Edward Smith-Rowland
d855ad89cb
c++14_warning.h: Do not refer C++14 as experimental.
...
2016-04-19 Edward Smith-Rowland <3dw4rd@verizon.net>
* include/bits/c++14_warning.h: Do not refer C++14 as experimental.
From-SVN: r235210
2016-04-19 16:29:05 +00:00
Jonathan Wakely
0cded43df4
PR libstdc++/41759 reword static assertions in <random>
...
PR libstdc++/41759
* include/bits/random.h: Reword static assertion messages to state
positive conditions.
* include/bits/random.tcc: Likewise.
* include/bits/uniform_int_dist.h: Likewise.
* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error
patterns.
From-SVN: r235160
2016-04-18 19:03:50 +01:00
Jonathan Wakely
90751aa731
Remove unused typedefs in std::bind types
...
* include/std/function (_Bind, _Bind_result): Remove unused typedefs.
From-SVN: r235157
2016-04-18 17:37:56 +01:00
Jonathan Wakely
351a5f8142
* config/cpu/sh/atomicity.h: Fix typo in comment.
...
From-SVN: r235156
2016-04-18 17:19:25 +01:00
Jonathan Wakely
b05cf382e0
Define std: 🧵 :id comparison operators at namespace-scope
...
From-SVN: r235155
2016-04-18 17:16:14 +01:00
Jonathan Wakely
4ed6e52446
Make use of extensions more explicit in libstdc++ tests
...
* testsuite/18_support/bad_exception/23591_thread-1.c: Add
-Wno-pedantic to dg-options.
* testsuite/20_util/align/2.cc: Use type as operand of alignof.
* testsuite/20_util/is_floating_point/value.cc: Add -Wno-pedantic
to dg-options.
* testsuite/20_util/specialized_algorithms/uninitialized_fill/32158.cc:
Remove extra semi-colon.
* testsuite/23_containers/array/tuple_interface/tuple_element.cc:
Always supply second argument to static_assert.
* testsuite/25_algorithms/lower_bound/no_operator_ne.cc: Remove extra
semi-colon.
* testsuite/26_numerics/complex/c99.cc: Add -Wno-pedantic to
dg-options.
* testsuite/26_numerics/complex/literals/values.cc: Likewise.
* testsuite/29_atomics/atomic/60695.cc: Likewise.
* testsuite/29_atomics/atomic/62259.cc: use __alignof__ instead of
alignof when operand is an object not a type.
* testsuite/decimal/ctor.cc: Add -Wno-pedantic to dg-options.
* testsuite/decimal/make-decimal.cc: Likewise.
* testsuite/experimental/type_traits/value.cc: Always supply second
argument to static_assert.
* testsuite/util/testsuite_common_types.h: Use __extension__ for
__int128 types.
From-SVN: r235154
2016-04-18 16:44:25 +01:00
Jonathan Wakely
abb6e0a19d
Don't include internal header in libstdc++ tests
...
* testsuite/experimental/type_erased_allocator/1.cc: Don't include
internal header.
* testsuite/experimental/type_erased_allocator/1_neg.cc: Likewise.
* testsuite/experimental/type_erased_allocator/2.cc: Likewise.
* testsuite/experimental/type_erased_allocator/uses_allocator.cc:
Likewise. Add licence and change to compile-only test.
From-SVN: r235153
2016-04-18 16:44:16 +01:00
Jonathan Wakely
6b6147dd48
Add attribute((unused)) in libstdc++ headers
...
* include/bits/locale_facets.h (ctype::do_narrow): Add attribute to
unused parameter.
* include/bits/regex_automaton.h (_NFA::_M_insert_alt): Likewise.
From-SVN: r235152
2016-04-18 16:44:12 +01:00
Jonathan Wakely
8dc1e574ae
Avoid -Wsign-compare warnings in std::to_string()
...
* include/ext/string_conversions.h (__stoa): Avoid -Wsign-compare
warnings.
From-SVN: r235151
2016-04-18 16:43:50 +01:00
Edward Smith-Rowland
80dbaf98d4
Trivial comment misspelling.
...
From-SVN: r235092
2016-04-18 02:32:50 +00:00
Edward Smith-Rowland
9a9534e162
Obvious typo in comment.
...
From-SVN: r235091
2016-04-18 02:30:31 +00:00
Jason Merrill
9f285ccb77
Revert empty class parameter passing ABI changes.
...
From-SVN: r234977
2016-04-14 12:23:06 -04:00
Martin Sebor
342fac9537
PR c++/69517 - [5/6 regression] SEGV on a VLA with excess initializer elements
...
PR c++/69517 - [5/6 regression] SEGV on a VLA with excess initializer elements
PR c++/70019 - VLA size overflow not detected
PR c++/70588 - SIGBUS on a VLA larger than SIZE_MAX / 2
gcc/testsuite/ChangeLog:
2016-04-13 Martin Sebor <msebor@redhat.com>
PR c++/69517
PR c++/70019
PR c++/70588
* c-c++-common/ubsan/vla-1.c (main): Catch exceptions.
* g++.dg/cpp1y/vla11.C: New test.
* g++.dg/cpp1y/vla12.C: New test.
* g++.dg/cpp1y/vla13.C: New test.
* g++.dg/cpp1y/vla14.C: New test.
* g++.dg/cpp1y/vla3.C: Restore deleted test.
* gcc/testsuite/g++.dg/init/array24.C: Fully brace VLA initializer.
* g++.dg/ubsan/vla-1.C: Disable exceptions.
gcc/cp/ChangeLog:
2016-04-13 Martin Sebor <msebor@redhat.com>
PR c++/69517
PR c++/70019
PR c++/70588
* cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
functions.
* decl.c (check_initializer, cp_finish_decl): Call them.
(reshape_init_r): Reject incompletely braced intializer-lists
for VLAs.
* init.c (throw_bad_array_length, build_vla_check)
(build_vla_size_check, build_vla_init_check): Define new functions.
* typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
to detect a VLA.
(store_init_value): Same.
gcc/doc/ChangeLog:
2016-04-13 Martin Sebor <msebor@redhat.com>
PR c++/69517
PR c++/70019
PR c++/70588
* extend.texi (Variable Length): Document C++ specifics.
libstdc++-v3/ChangeLog:
2016-04-13 Martin Sebor <msebor@redhat.com>
PR c++/69517
* testsuite/25_algorithms/rotate/moveable2.cc: Make sure VLA
upper bound is positive.
From-SVN: r234966
2016-04-13 17:26:41 -06:00
Jonathan Wakely
a6297ab587
Adjust for new empty class parameter passing ABI.
...
* include/bits/c++config (_GLIBCXX_BEGIN_NAMESPACE_EMPTY_TYPES,
_GLIBCXX_END_NAMESPACE_EMPTY_TYPES, _GLIBCXX_ABI_TAG_EMPTY): Define.
* include/bits/hashtable.h (_Hashtable::_M_emplace): Change signatures
of functions taking empty structs by value. Add a template parameter
to overloads without hints. Rename overloads with hints to
_M_emplace_hint.
(_Hashtable::_M_erase(true_type, const_iterator),
_Hashtable::_M_erase(false_type, const_iterator)): Change signatures
by reordering parameters.
* include/bits/hashtable_policy.h (_Insert::insert): Adjust to call
_M_emplace_hint instead of _M_emplace.
* include/bits/shared_ptr.h (shared_ptr(_Tp1*, _Deleter, _Alloc),
shared_ptr(nullptr_t, _Deleter, _Alloc)): Use _GLIBCXX_ABI_TAG_EMPTY.
* include/bits/shared_ptr_base.h (_Sp_counted_deleter, __shared_count,
__shared_ptr): Likewise.
* include/bits/stl_algo.h (replace_if): Likewise.
* include/bits/stl_pair.h (piecewise_construct_t,
piecewise_construct): Use _GLIBCXX_BEGIN_NAMESPACE_EMPTY_TYPES.
* include/bits/uses_allocator.h (allocator_arg_t, allocator_arg,
__uses_alloc0): Likewise.
* include/ext/pb_ds/assoc_container.hpp (basic_hash_table): Likewise.
* testsuite/20_util/scoped_allocator/69293_neg.cc: Adjust dg-error.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Likewise.
* testsuite/20_util/shared_ptr/cons/void_neg.cc: Likewise.
* testsuite/20_util/uses_allocator/69293_neg.cc: Likewise.
* testsuite/20_util/uses_allocator/cons_neg.cc: Likewise.
* testsuite/ext/profile/mutex_extensions_neg.cc: Likewise.
From-SVN: r234964
2016-04-13 23:00:50 +01:00
Edward Smith-Rowland
0c39f36dc5
Document C++17/TR29124 C++ Special Math Functions.
...
2016-04-12 Edward Smith-Rowland <3dw4rd@verizon.net>
Document C++17/TR29124 C++ Special Math Functions.
* include/bits/specfun.h: Add Doxygen markup.
From-SVN: r234905
2016-04-12 16:31:25 +00:00
Jonathan Wakely
6da8b93163
* testsuite/30_threads/thread/70503.cc: Adjust from xfail to pass.
...
From-SVN: r234808
2016-04-07 15:26:24 +01:00
Eric Botcazou
49a52ebcc0
Makefile.am (libstdc++-symbols.ver): Remove useless /dev/null.
...
* src/Makefile.am (libstdc++-symbols.ver): Remove useless /dev/null.
* src/Makefile.in: Regenerate.
From-SVN: r234782
2016-04-06 15:07:49 +00:00
Jonathan Wakely
d2aee115cc
Restore atomic builtins usage in libstdc++-v3
...
PR libstdc++/70554
* acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Don't test
__atomic_fetch_add for bool.
* configure: Regenerate.
From-SVN: r234761
2016-04-05 20:03:46 +01:00
Jonathan Wakely
d5ec69f374
* testsuite/30_threads/thread/70503.cc: Require -static to work.
...
From-SVN: r234757
2016-04-05 18:21:48 +01:00
Jonathan Wakely
87cec93ee0
Ensure std::thread helpers have internal linkage
...
PR libstdc++/70503
* src/c++11/thread.cc (execute_native_thread_routine,
execute_native_thread_routine_compat): Give internal linkage.
* testsuite/30_threads/thread/70503.cc: New test.
From-SVN: r234746
2016-04-05 14:35:32 +01:00
Ville Voutilainen
7b3318c41e
re PR libstdc++/70437 (Instantiation loop with pair and is_constructible)
...
PR libstdc++/70437
* include/bits/stl_pair.h (_ConstructiblePair,
_ImplicitlyConvertiblePair, _MoveConstructiblePair,
_ImplicitlyMoveConvertiblePair): Add shortcut conditions
for same-type cases.
* testsuite/20_util/pair/70437.cc: New.
From-SVN: r234743
2016-04-05 14:31:30 +03:00
Jonathan Wakely
00e6c25ac8
libstdc++/69945 Add __gnu_cxx::__freeres hook
...
PR libstdc++/69945
* config/abi/pre/gnu.ver: Add new symbol.
* libsupc++/eh_alloc.cc (__gnu_cxx::__freeres): Define.
* testsuite/18_support/free_eh_pool.cc: New test.
From-SVN: r234465
2016-03-24 18:13:40 +00:00
Bernd Edlinger
bfd84e6ba5
Makefile.am (install-freestanding-headers): Add concept_check.h and move.h to the installed headers.
...
2016-03-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
* include/Makefile.am (install-freestanding-headers): Add
concept_check.h and move.h to the installed headers.
* include/Makefile.in: Regenerated.
* include/bits/concept_check.h: Ignore _GLIBCXX_CONCEPT_CHECKS for
freestanding implementations.
* doc/xml/manual/using.xml (_GLIBCXX_CONCEPT_CHECKS): Mention
that this macro has no effect for freestanding implementations.
* doc/html/manual/using_macros.html: Likewise.
From-SVN: r234414
2016-03-23 00:41:52 +00:00
Uros Bizjak
f2f48c6c60
* libsupc++/guard.cc: Revert my last commit.
...
From-SVN: r234336
2016-03-18 16:44:44 +01:00
Uros Bizjak
09d8f35943
Revert:
...
2015-07-02 Uros Bizjak <ubizjak@gmail.com>
* libsupc++/guard.cc (__test_and_acquire): Use __p after __atomic_load
to avoid unused variable warning.
(__set_and_release): Use __p after __atomic_store to avoid unused
variable warning.
From-SVN: r234331
2016-03-18 16:28:54 +01:00
Jonathan Wakely
86715b0917
libstdc++/69939 Qualify get and forward
...
PR libstdc++/69939
* include/experimental/tuple (__apply_impl): Qualify get and forward.
From-SVN: r233666
2016-02-24 13:59:29 +00:00
Jonathan Wakely
be9967e877
Document __STDCPP_WANT_MATH_SPEC_FUNCS__ macro
...
* doc/xml/manual/using.xml: Document __STDCPP_WANT_MATH_SPEC_FUNCS__.
* doc/html/*: Regenerate.
From-SVN: r233645
2016-02-23 20:03:30 +00:00
Jonathan Wakely
9aee022eb9
libstdc++/69893 make <tr1/cmath> work with C++11
...
PR libstdc++/69893
* include/tr1/cmath (acosh, asinh, atanh, cbrt, copysign, erf, erfc,
exp2, expm1, fdim, fma, fmax, fmin, hypot, ilogb, lgamma, llrint,
llround, log1p, log2, logb, lrint, lround, nan, nearbyint, nextafter,
nexttoward, remainder, remquo, rint, round, scalbln, scalbn, tgamma,
trunc) [__cplusplus >= 201103L]: Import from namespace std.
(fabs) [__cplusplus < 201103L]: Import from namespace std.
* include/tr1/complex (acosh, asinh, atanh) [__cplusplus >= 201103L]:
Likewise.
* testsuite/tr1/headers/c++200x/complex.cc: Add std::fabs to global
namespace before including TR1 headers.
* testsuite/tr1/headers/c++200x/math.cc: New test.
From-SVN: r233644
2016-02-23 19:49:31 +00:00
Bernd Edlinger
5f6dd5930f
re PR libstdc++/69881 (with gcc-6 of today building gcc-4.9 fails)
...
2016-02-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR libstdc++/69881
* include/c_global/cstdarg: Undefine __need___va_list.
* include/c_global/cstddef: Undefine all kinds of __need_*.
From-SVN: r233636
2016-02-23 15:57:09 +00:00
Tim Shen
244901a572
re PR libstdc++/69794 (std::regex_search match failure with regex object with flags grep|icase)
...
2016-02-16 Tim Shen <timshen@google.com>
PR libstdc++/69794
* include/bits/regex_scanner.h: Add different special character
sets for grep and egrep regex.
* include/bits/regex_scanner.tcc: Use _M_spec_char more uniformly.
* testsuite/28_regex/regression.cc: Add new testcase.
From-SVN: r233482
2016-02-17 03:33:02 +00:00
Mike Stump
82f0f78917
Fix FAIL: special_functions/18_riemann_zeta/check_value.cc (test for excess errors)
...
From-SVN: r233391
2016-02-12 21:23:11 +00:00
Mike Stump
af583c4457
Ensure stdout is newline terminated for status wrappers.
...
From-SVN: r233254
2016-02-09 20:18:10 +00:00
Jonathan Wakely
2158532f31
Remove accidentally added 'constexpr' in previous commit
...
* acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): Remove accidentally
added 'constexpr' in previous commit.
* configure: Regenerate.
From-SVN: r233219
2016-02-08 15:37:59 +00:00
Jonathan Wakely
cc07da33ae
Enable isinf/isnan checks for all targets
...
PR libstdc++/48891
* acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): Enable isinf and isnan
checks for all targets except *-*-solaris2.* and ensure we find the
libc math.h header not our own.
* configure: Regenerate.
From-SVN: r233214
2016-02-08 15:22:32 +00:00
Dominik Vogt
acc046464c
libstdc++: S/390: Add missing baseline_symbols.txt for s390x/-m31.
...
The attached patch copies the existing
libstdc++-v3/config/abi/post/s390-linux-gnu/baseline_symbols.txt
to .../s390x-linux-gnu/32/baseline_symbols.txt. This fixes the
abi test failure on s390x with -m31.
libstdc++-v3/ChangeLog
* config/abi/post/s390x-linux-gnu/32/baseline_symbols.txt (FUNC):
New file. Copied over from s390-linux-gnu.
From-SVN: r233170
2016-02-05 10:25:08 +00:00
Jonathan Wakely
3555173fb9
Test for C99 stdlib.h functions with -std=c++98
...
PR libstdc++/69626
* acinclude.m4 (GLIBCXX_ENABLE_C99): Check C99 stdlib.h functions
with -std=c++98 and define _GLIBCXX98_USE_C99_STDLIB.
* config.h.in: Regenerate.
* configure: Regenerate.
* testsuite/21_strings/c_strings/char/69626.cc: New.
From-SVN: r233161
2016-02-04 23:47:21 +00:00
Jonathan Wakely
15ebf37974
Regenerate front page of libstdc++ HTML docs
...
* doc/html/index.html: Regenerate.
From-SVN: r233151
2016-02-04 21:46:19 +00:00
Jonathan Wakely
dbcda3ee8e
Update copyright years in libstdc++ manual and add link
...
* doc/xml/manual/containers.xml: Add cross-reference to Dual ABI.
* doc/xml/manual/spine.xml: Update copyright years and author blurb.
* doc/html/*: Regenerate.
From-SVN: r233150
2016-02-04 21:43:40 +00:00
Bernd Edlinger
571512d5f5
Don't define guard macros when doing #include_next in math.h and stdlib.h
...
2016-02-01 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR libstdc++/69581
* include/c_compatibility/math.h: Move header guards.
* include/c_compatibility/stdlib.h: Likewise.
From-SVN: r233035
2016-02-01 11:13:40 +00:00
Jonathan Wakely
f597d5f73c
Fix Cygwin bootstrap error due to TM symbols
...
PR libstdc++/69506
* config/os/newlib/os_defines.h (_GLIBCXX_USE_WEAK_REF): Define.
From-SVN: r232974
2016-01-29 10:52:08 +00:00
John David Anglin
69b0daeb4a
re PR libstdc++/69450 (libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration)
...
PR libstdc++/69450
* acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): Split check for obsolete
isinf and isnan functions into two independent checks. Check on hpux.
* config.h.in: Regenerate.
* configure: Regenerate.
* include/c_global/cmath (isinf(double), isnan(double)): Use
_GLIBCXX_HAVE_OBSOLETE_ISINF and _GLIBCXX_HAVE_OBSOLETE_ISNAN,
respectively.
From-SVN: r232925
2016-01-28 13:09:23 +00:00
Jakub Jelinek
8dc781e454
* testsuite/libstdc++-prettyprinters/whatis.cc: Include <random>.
...
From-SVN: r232898
2016-01-27 20:31:06 +01:00
Jonathan Wakely
bae87f7fdd
Set FP options for failing special functions tests
...
PR libstdc++/69295
* testsuite/ext/special_functions/hyperg/check_value.cc: Use
-ffp-contract=off, and -ffloat-store to disable excess precision.
* testsuite/special_functions/02_assoc_legendre/check_value.cc: Use
-ffp-contract=off.
From-SVN: r232879
2016-01-27 15:09:38 +00:00
Jonathan Wakely
f1d591e8a6
Fix assertions for move assignment of trivial types
...
PR libstdc++/69478
* include/bits/stl_algobase.h (__copy_move<_IsMove, true,
random_access_iterator_tag>): Check is_move_assignable when moving.
(__copy_move_backwards<_IsMove, true, random_access_iterator_tag>):
Likewise.
* testsuite/25_algorithms/copy/move_iterators/69478.cc: New.
* testsuite/25_algorithms/copy_backward/move_iterators/69478.cc: New.
* testsuite/25_algorithms/move/69478.cc: New.
* testsuite/25_algorithms/move_backward/69478.cc: new.
From-SVN: r232842
2016-01-26 19:38:20 +00:00
Andris Pavenis
8964d2a090
Fix build failure when wide character support is not available
...
* include/c_compatibility/stdlib.h: Include wide character related
definitions only when they are available in cstdlib.
From-SVN: r232835
2016-01-26 18:07:33 +02:00
Jonathan Wakely
2944621e2c
Avoid including all of <random> in <algorithm>
...
PR libstdc++/69464
* include/Makefile.am: Add new header.
* include/Makefile.in: Regenerate.
* include/bits/random.h (uniform_int_distribution): Move to
bits/uniform_int_dist.h.
* include/bits/random.tcc (uniform_int_distribution::operator(),
uniform_int_distribution::__generate_impl): Likewise.
* include/bits/uniform_int_dist.h: New header.
* include/bits/stl_algo.h [__cplusplus >= 201103L]: Include
<bits/uniform_int_dist.h> instead of <random>.
* testsuite/20_util/specialized_algorithms/uninitialized_copy/
move_iterators/1.cc: Include correct header for uninitialized_copy.
* testsuite/20_util/specialized_algorithms/uninitialized_copy_n/
move_iterators/1.cc: Likewise.
* testsuite/25_algorithms/nth_element/58800.cc: Include correct
header for vector.
* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error lines.
From-SVN: r232798
2016-01-25 16:44:30 +00:00