Commit Graph

2771 Commits

Author SHA1 Message Date
Akira Hatanaka 2556b769ec [libcxx] Fix a bug in strstreambuf::overflow.
The end pointer should point to one past the end of the newly allocated
buffer.

rdar://problem/24265174

Differential Revision: http://reviews.llvm.org/D20334

llvm-svn: 274132
2016-06-29 15:26:13 +00:00
Marshall Clow 91bd7dda3a Use WG21.link reflector to get to issues, rather than linking directly
llvm-svn: 274018
2016-06-28 14:13:28 +00:00
Marshall Clow baf27df0bf Updated C++1Z status page with new work from Oulu WG21 meeting
llvm-svn: 274016
2016-06-28 14:11:54 +00:00
Marshall Clow 3044c34c45 Fix bad link for P0006
llvm-svn: 273861
2016-06-27 11:14:34 +00:00
Eric Fiselier e3c72c1c85 Fix UB in uses_alloc_types.hpp
llvm-svn: 273840
2016-06-27 01:52:14 +00:00
Eric Fiselier 68436a9b48 Implement P0163r0. Add shared_ptr::weak_type.
This patch adds the weak_type typedef in shared_ptr. It is available in
C++17 and newer.

This patch also updates the _LIBCPP_STD_VER and TEST_STD_VER macros to
have the value of 16, since 2016 is the current year.

llvm-svn: 273839
2016-06-27 01:02:43 +00:00
Eric Fiselier 8b7faa6871 Implement p0337r0. Delete operator= for polymorphic_allocator.
llvm-svn: 273838
2016-06-27 00:55:25 +00:00
Eric Fiselier 9372d8bc61 Implement P0358r1. Fixes for not_fn.
llvm-svn: 273837
2016-06-27 00:40:41 +00:00
Eric Fiselier 06e9017d7b Fix C++03 failure in enable_shared_from_this test
llvm-svn: 273836
2016-06-27 00:38:28 +00:00
Eric Fiselier 39005d3019 Fix PR27115 - enable_shared_from_this does not work as a virtual base class.
See https://llvm.org/bugs/show_bug.cgi?id=27115

The problem was that the conversion from
'const enable_shared_from_this<T>*' to 'const T*' didn't work if
T inherited enable_shared_from_this as a virtual base class. The fix
is to take the original pointer passed to shared_ptr's constructor in the
__enable_weak_this method and perform an upcast to 'const T*' instead of
performing a downcast from the enable_shared_from_this base.

llvm-svn: 273835
2016-06-26 23:56:32 +00:00
Eric Fiselier 66fe5a4e2b Fix C++03 build
llvm-svn: 273832
2016-06-26 23:18:23 +00:00
Eric Fiselier bb94dca13a Fix PR28079 - std::wstring_convert move constructor broken.
The move constructor for wstring_convert accidentally copied the state member
into the converted count member in the move constructor. This patch fixes
the typo.

While working on this I discovered that wstring_convert doesn't actually
provide a move constructor according to the standard and therefore this
constructor is a libc++ extension. I'll look further into whether libc++ should
provide this constructor at all. Neither libstdc++ or MSVC's STL provide it.

llvm-svn: 273831
2016-06-26 22:56:26 +00:00
Eric Fiselier 555330719a Implement LWG 2488 - Make the placeholders constexpr.
This patch makes the bind placeholders in std::placeholders both (1) const and
(2) constexpr (See below).

This is technically a breaking change for any code using the placeholders
outside of std::bind and depending on them being non-const. However I don't
think this will break any real world code.

(1) Previously the placeholders were non-const extern globals in all
dialects. This patch changes these extern globals to be const in all dialects.
Since the cv-qualifiers don't participate in name mangling for globals this
is an ABI compatible change.

(2) Make the placeholders constexpr in C++11 and beyond. Although LWG 2488 only
applies to C++17 I don't see any reason not to backport this change.

llvm-svn: 273824
2016-06-26 21:01:34 +00:00
Eric Fiselier a9fb19d3a5 Make default_noexcept.pass.cpp container tests more portable. Patch from STL@microsoft.com
llvm-svn: 273823
2016-06-26 20:21:22 +00:00
Eric Fiselier 7cca38bfd1 Work around MSVC bug in atomics.types.generic/address.pass.cpp test. Patch from STL@microsoft.com
llvm-svn: 273822
2016-06-26 19:59:11 +00:00
Eric Fiselier 384e012561 Use L"cat" L"dog" when concatenating string literals. Patch from STL@microsoft.com
llvm-svn: 273821
2016-06-26 19:53:46 +00:00
Eric Fiselier 2e0e3df9da Add array bounds assertions to satisfy MSVC's /analyze flag. Patch from STL@microsoft.com
llvm-svn: 273820
2016-06-26 19:48:29 +00:00
Eric Fiselier 3740071be0 Add [[noreturn]] attribute to throw_bad_alloc_helper().
llvm-svn: 273819
2016-06-26 19:42:59 +00:00
Eric Fiselier 95b5ac7df9 Avoid narrowing conversions in quoted test. Patch from STL@microsoft.com
llvm-svn: 273818
2016-06-26 19:37:23 +00:00
Weiming Zhao 41583957a5 [libcxx] guard throw with exception enabling check
Summary: this fixes build error when built with c++14 and no exceptions

Reviewers: rmaprath

Subscribers: weimingz, grandinj, rmaprath, cfe-commits

Differential Revision: http://reviews.llvm.org/D21673

llvm-svn: 273697
2016-06-24 18:02:27 +00:00
Eric Fiselier 351a709781 Run list debug copy test in C++03.
llvm-svn: 273395
2016-06-22 08:57:33 +00:00
Eric Fiselier 75fd25e4bc Finish converting list _LIBCPP_DEBUG tests.
llvm-svn: 273394
2016-06-22 08:47:43 +00:00
Eric Fiselier 3624fedb68 Cleanup _LIBCPP_DEBUG tests in std::list. More to come.
llvm-svn: 273393
2016-06-22 08:01:27 +00:00
Eric Fiselier e357c0ad3b Cleanup filesystem::permissions ever more.
llvm-svn: 273392
2016-06-22 07:57:38 +00:00
Eric Fiselier c4f6eda006 Avoid unnecessary stat call in filesystem::permissions implementation.
llvm-svn: 273391
2016-06-22 07:24:00 +00:00
Eric Fiselier eea7a01a28 Disable ccache usage for .fail.cpp tests. It causes bugs.
llvm-svn: 273390
2016-06-22 07:09:59 +00:00
Eric Fiselier 0e9272bee2 Placate MSVC's unchecked malloc warning in thread tests.
llvm-svn: 273385
2016-06-22 05:44:08 +00:00
Eric Fiselier 19d44836d7 Use correct Clang feature names. I got them wrong in the previous commit
llvm-svn: 273384
2016-06-22 05:40:17 +00:00
Eric Fiselier 94713d1671 Support old GCC exception and rtti detection macros
llvm-svn: 273383
2016-06-22 05:33:52 +00:00
Eric Fiselier 88d38802e2 Add tests for RTTI/exceptions test macros.
llvm-svn: 273382
2016-06-22 05:29:15 +00:00
Eric Fiselier eb067d4ebd Fix exception/rtti detection in tests.
So the macros TEST_HAS_NO_EXCEPTIONS and TEST_HAS_NO_RTTI were always
getting defined because I spelt __cpp_exceptions and __cpp_rtti as
__cxx_exceptions and __cxx_rtti.

Tests incoming after this patch.

llvm-svn: 273381
2016-06-22 05:03:10 +00:00
Eric Fiselier 74480010dc Make shared_ptr constructor tests use count_new.hpp
llvm-svn: 273379
2016-06-22 04:51:07 +00:00
Eric Fiselier 739cc95471 Make locale constructors tests use count_new.hpp
llvm-svn: 273375
2016-06-22 04:34:24 +00:00
Eric Fiselier cc4162293f Placate MSVC's unchecked malloc warnings.
llvm-svn: 273374
2016-06-22 04:23:54 +00:00
Eric Fiselier 32853ad707 UBSan doesn't globally replace new/delete but it still makes some tests fail. Investigation needed.
llvm-svn: 273372
2016-06-22 04:00:45 +00:00
Eric Fiselier 8ff7432534 Cleanup [list.modifiers] tests.
llvm-svn: 273371
2016-06-22 03:46:32 +00:00
Eric Fiselier a97d34a982 Don't use non-conforming pointer_traits specialization it tests.
llvm-svn: 273368
2016-06-22 02:31:32 +00:00
Eric Fiselier 56f23a3f7f Move remaining _LIBCPP_VERSION tests into test/libcxx
llvm-svn: 273367
2016-06-22 02:23:22 +00:00
Eric Fiselier 189d6a8834 Move more _LIBCPP_VERSION tests to test/libcxx.
llvm-svn: 273365
2016-06-22 02:07:26 +00:00
Eric Fiselier 0202dec266 Move all tests for _LIBCPP_VERSION in language.support to test/libcxx/language.support.
llvm-svn: 273364
2016-06-22 01:55:59 +00:00
Eric Fiselier 505ceacd3b Move typoed dir meta.hel to meta.help
llvm-svn: 273362
2016-06-22 01:42:39 +00:00
Eric Fiselier 77d2d95973 Use static_assert instead of runtime assert in std::money_base tests.
llvm-svn: 273360
2016-06-22 01:40:46 +00:00
Eric Fiselier bae51d36aa Remove locale tests that depend on LC_ALL. These are non-portable.
llvm-svn: 273359
2016-06-22 01:33:38 +00:00
Eric Fiselier 46fb2b903e Fix comment typos, strip trailing whitespace. Patch from STL@microsoft.com
llvm-svn: 273357
2016-06-22 01:23:51 +00:00
Eric Fiselier 8d0d842e7b Avoid huge main() functions and huge arrays. Patch from STL@microsoft.com
llvm-svn: 273354
2016-06-22 01:13:44 +00:00
Eric Fiselier 7a580d0a72 Don't use C++17 terse static assert. Patch from STL@microsoft.com
llvm-svn: 273353
2016-06-22 01:10:14 +00:00
Eric Fiselier 060ecaf672 Fix operator precedence mistake in valarray/not.pass.cpp. Patch from STL@microsoft.com
llvm-svn: 273352
2016-06-22 01:04:09 +00:00
Eric Fiselier 408d6ebd2d Suppress stupid and incorrect MSVC warning. patch from STL@microsoft.com
llvm-svn: 273350
2016-06-22 01:02:08 +00:00
Eric Fiselier df839e04b4 Avoid assignment in return. Patch from STL@microsoft.com
llvm-svn: 273349
2016-06-22 01:00:32 +00:00
Eric Fiselier c1d08ff069 Suppress unused warnings in std::invoke tests.
llvm-svn: 273348
2016-06-22 00:58:06 +00:00