Commit Graph

1471 Commits

Author SHA1 Message Date
Marshall Clow
48e7e9f403 Support the built-in type-trait support in gcc 4.7 and later. Thanks to Albert Wong for the patch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212727 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-10 15:38:20 +00:00
Marshall Clow
a64392627e Add support for BIONIC C library (Android). Patch from Dan Albert
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212724 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-10 15:20:28 +00:00
Marshall Clow
7778249d2d Fix warning in test - missing exception specifier for overload of operator new
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212723 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-10 15:19:50 +00:00
Marshall Clow
bbeca21f26 Add a reset method to the counting predicates in the test suite
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212651 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-09 21:04:22 +00:00
Marshall Clow
484728789e string_view enhancements. Move to the correct namespace. Better constexpr support (thanks to Richard for the suggestions). Update the tests to match this. Add <experimental/__config for experimental macros/etc to live.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212569 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-08 22:38:11 +00:00
Marshall Clow
51349536aa Fix some failing tests for the standard containers. The tests were failing in 32-bit mode because they assumed that std::size_type and make_unsigned<ptrdiff_t>::type were always the same type. No change to libc++, just the tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212538 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-08 15:19:40 +00:00
Marshall Clow
3a61b30f3a Minor cleanup for string_view; mostly from suggestions by Richard Smith. Also, make the tests pass under c++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212185 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-02 15:45:57 +00:00
Marshall Clow
2f9e714071 Fix libc++ bug #20039: 'Constructing std::function from empty compatible std::function results in half-empty state' Thanks to Agustin Berge for the report, and for his and Eric Fiselier's work on a fix.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212070 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-30 21:27:51 +00:00
Marshall Clow
394451db81 Fix a typo in the noexcept calculation for __compressed_pair::swap. Thanks to EricWF for the bug report and the fix.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212046 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-30 15:35:09 +00:00
Marshall Clow
c8c7abae66 Add checking for the complexity guarantees in the standard
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212017 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-30 05:04:20 +00:00
Marshall Clow
81aa3a745c Patch from Albert J. Wong to make type_traits take advantage of gcc intrinsics in 4.7 and later. No functionality change when using clang.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@211755 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-26 01:07:56 +00:00
David Fang
44ead61237 eliminate install of duplicate headers (take 2)
Patch by Ryuta Suzuki

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@211629 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-24 20:32:11 +00:00
Marshall Clow
ba6dbf4866 Some calls to get<>() were qualified. Some were not. Qualify them all. Fixes bug #20092. Thanks to Agustín Bergé for the bug report and the fix.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@211563 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-24 00:46:19 +00:00
Marshall Clow
e4694b4129 Formatting improvements in the <string_view> synopsis suggested by RSmith. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@211191 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-18 17:44:04 +00:00
David Fang
04035d66d0 Revert "fixes duplicate header installation"
This reverts commit 0bd40d6c3d.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210857 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-12 23:19:55 +00:00
Marshall Clow
164b297099 Implement string_view from the library fundamentals TS (n4023). Also works in C++11 and 03, with reduced functionality (mostly in the area of constexpr)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210659 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-11 16:44:55 +00:00
David Fang
0bd40d6c3d fixes duplicate header installation
http://llvm.org/bugs/show_bug.cgi?id=18681
Patch by Ryuta Suzuki <oroppas gmail com>

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210577 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-10 20:26:54 +00:00
Marshall Clow
675dd5cc4f Mark assign to be constepr only in c++14; can't have constexpr fns that return void in C++11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210562 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-10 18:52:57 +00:00
Marshall Clow
37025e1b32 Make the helper routines in string really be constexpr. This required a bit of refacoring in algorithm as well. Give them better names while we're at it. All of these are internal rotines; no visible functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210561 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-10 18:51:55 +00:00
Marshall Clow
c1345e3262 A bunch of the char.traits tests were using unicode literals. #ifdef those bits out on c++03, since it doesn't support u"" and U "" style strings.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210560 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-10 18:46:59 +00:00
David Blaikie
c743921e51 Update Arcanist config to point to reviews.llvm.org
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210558 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-10 18:29:36 +00:00
Marshall Clow
5520bf5cbe Fixed damaged row in issues table; thanks to STL for the catch
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210500 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 23:27:27 +00:00
Marshall Clow
281918b6aa Testing infastructure: A template for char_traits where all the functions are constexpr, and a comparison predicate which counts how many times it's been called.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210381 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-06 22:33:40 +00:00
Marshall Clow
20f0955062 Since we now have a value for __cplusplus for c++14, teach libc++ about it
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210380 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-06 22:31:09 +00:00
Richard Smith
73c1fce21c Use __builtin_operator_new/__builtin_operator_delete when available. This
allows allocations and deallocations to be optimized out.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210211 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 19:54:15 +00:00
David Majnemer
0707b67ac3 Handle partial nanosleeps in this_thread::sleep_for
Signals may result in nanosleep returning with only some of the
requested sleeping performed.

Utilize nanosleep's "time-remaining" out parameter to continue sleeping
when this occurs.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210210 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 19:43:20 +00:00
Nico Weber
981b01d9d0 Make meta.trans.other/aligned_storage.pass.cpp pass on arm.
The maximum alignment on arm is 8, not 16 like on x86. Use alignof(max_align_t)
to make the test work in both cases.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210195 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 16:25:58 +00:00
Nico Weber
0211e86a5e Make locales (and transitively, std::endl) work reliably with gcc.
libc++ currently relies on undefined initialization order of global
initializers when using gcc:

1. __start_std_streams in iostream.cpp calls locale:🆔:_init, which assigns
   an id to each locale::facet in an initializer

2. Every facet has a static locale::id id, whose constructor sets the facet's
   id to 0

If 2 runs after 1, it clobbers the facet's assigned consecutive id, causing
exceptions to be thrown when e.g. running code like "cout << endl".

To fix this, let _LIBCPP_CONSTEXPR evaluate to "constexpr" instead of nothing
with gcc.  locale::id's constructor is marked _LIBCPP_CONSTEXPR, which ensures
that it won't get an initializer that could potentially run after the
iostream.cpp initializer. (This remains broken when building with msvc.)

Also switch constexpr-specific code in bitset to use __SIZEOF_SIZE_T__ instead
of __SIZE_WIDTH__, because gcc doesn't define the latter.

Pair-programmed/debugged with Dana Jansens.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210188 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 15:46:56 +00:00
Marshall Clow
5a54699578 Add a note about debug mode being non-functional
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210162 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 04:49:49 +00:00
David Majnemer
4d9f97b40b [libc++] Don't return uninitialized data from random_device::operator()
Make sure we appropriately retry calls to read if the return result is
less than what we asked for.

Additionally, check and handle IO errors: EINTR results in the read
operation getting restarted; other errors turn into exceptions.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210061 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-03 02:40:39 +00:00
David Majnemer
8db32cc2ac [libc++] random_device fails if open returns zero
random_device::random_device(const string&) wrongly assumes that open
can only validly return a file descriptor greater than zero.

This results in random_device believing that it didn't successfully open
the device causing it to throw in it's constructor, this ends up leaking
a file descriptor.

The fix is simple, don't error on file descriptors which are zero.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210060 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-03 02:21:37 +00:00
Marshall Clow
d2f0b5c9ae First cut at a post c++14 status page
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210056 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-02 23:37:13 +00:00
Nico Weber
4074d6ea30 Remove unused code in a libc++ test.
Other tests in this directory use this type, so it's probably copypasta from
there.

(test_buf only forwards to the superclass in all tests where it's used though,
so I wonder if it can be replaced with just using filebuf / wfilebuf
everywhere?)


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210019 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-02 12:00:08 +00:00
Marshall Clow
360f3196d7 Preparation for <string_view>. More helper functions that can be shared between <string> and <string_view>. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210002 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-02 02:22:49 +00:00
Justin Bogner
e39915bdc5 Fix XFAIL condition from r208840
The XFAILs in r208840 were too general. They were meant to only apply
to testing when use_system_lib was set.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209972 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-31 07:59:03 +00:00
Nico Weber
3c122d81be Add a _LIBCPP_CONSTEXPR that was missed in r170026.
(clang doesn't complain about this, but gcc does.  This is necessary for a
follow-up patch that will enable _LIBCPP_CONSTEXPR for gcc.)


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209888 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-30 12:09:47 +00:00
Nico Weber
d32add4a48 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209819 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29 14:58:38 +00:00
David Majnemer
fcafd80ace Linux: Correctly identify valid error codes
[syserr.errcat.objects]p4 specifies that
system_category().default_error_condition(ev) map to
error_condition(posv, generic_category()) if ev could map to a POSIX
errno.

Linux reserves up to and including 4095 for errno values, use this as a
bound.

This fixes syserr.errcat.objects/system_category.pass.cpp on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209795 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29 05:02:22 +00:00
Marshall Clow
4f3368e269 Fix a problem exposed by r208825, which caused bind (and other bits of libc++) to stop working. And tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209785 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29 01:10:28 +00:00
Marshall Clow
52a708fbca Fix bug 19840, where some tests were not testing what we wanted. Thanks to Eric for the bug report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209520 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-23 15:30:23 +00:00
Marshall Clow
6b7e6921e2 Fix Bug 19678 - libc++ does not correctly handle the regex: '[^\0]*'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209307 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21 16:29:50 +00:00
Marshall Clow
117563c516 Fix bug 19740; round-tripping a pointer through a stream doesn't work
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209305 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21 16:02:20 +00:00
Richard Smith
f33ffcc651 [modules] Add initial module map for libc++.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209265 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21 00:33:49 +00:00
Nico Weber
7fac8f6b9f Update cstddef after clang r207606.
r207606 changed the __need_foo macros to behave like they do with gcc: If they
are set, _only_ the __need_foo stuff gets defined.  As a consequence, cstddef
no longer defined "offsetof".  It looks like the __need_foo defines aren't
needed anymore, so just remove them.

Fixes PR19723.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208942 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 01:45:02 +00:00
Alp Toker
08f8ac6951 Fix typo 'fourty' in tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208870 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 11:33:29 +00:00
Alp Toker
ec34c48976 Fix typos
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208869 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 11:27:39 +00:00
Justin Bogner
5fda8338b2 Work around ABI differences due to LWG 2056 in tests
When testing against the system library, there is a relatively minor
ABI breakage that the std::future_errc values have been changed to
avoid using zero. Update the tests that rely on the values being
consistent.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208840 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 01:57:42 +00:00
Justin Bogner
bdfc0ad2ea Remove XFAIL from a number of tests that aren't expected to fail
These tests haven't been failing on darwin11 or 12 since r189610 when
pr17027 was fixed, but they've been keeping the libc++ bot red by
XPASSing since then.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208831 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 00:55:44 +00:00
Marshall Clow
1f50f2d64b Add Address Sanitizer support to std::vector
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208319 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-08 14:14:06 +00:00
Marshall Clow
6b5be703db Fix PR 19663. Some calls to find(vector<bool>) were returning iterators that were subtly invalid (didn't compare equal). Thanks to Erik Verbruggen for the report (and diagnosis)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208096 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-06 15:33:23 +00:00