Jonathan Roelofs
b3fcc67f8f
Allow libc++ to be built on systems without POSIX threads
...
If you're crazy enough to want this sort of thing, then add
-D_LIBCPP_HAS_NO_THREADS to your CXXFLAGS and
--param=additiona_features=libcpp-has-no-threads to your lit commnad line.
http://reviews.llvm.org/D3969
llvm-svn: 217271
2014-09-05 19:45:05 +00:00
Jonathan Roelofs
3547c5441e
Set -D_LIBCPP_HAS_NO_THREADS and -D_LIBCPP_HAS_NO_MONOTONIC_CLOCK based on available_features
...
http://reviews.llvm.org/D5214
llvm-svn: 217261
2014-09-05 17:21:57 +00:00
Justin Bogner
2cfd1fed21
test: Make it possible to opt in to use_clang_verify per test
...
This modifies the use_clang_verify parameter I added in r217009 to
only apply to tests that specifically ask for it via // USE_VERIFY.
This allows us to incrementally convert tests, but start enjoying the
benefits right away.
Suggested by Eric Fiselier in code review.
llvm-svn: 217017
2014-09-03 06:01:52 +00:00
Justin Bogner
33a2a2ed1a
test: Allow using clang -verify for failures rather than exit 1
...
Currently, failure tests work by checking that compilation exits 1.
This can lead to tests that fail for the wrong reason, so it'd be
preferable to convert them to check for specific errors.
This adds use_clang_verify parameter that runs failure tests using
clang's -verify flag. I'll convert some tests in subsequent commits,
and once all of the tests are converted we should key this on whether
cxx_under_test is clang.
I've also converted one of the unique.ptr tests, since it's the one
that motivated the idea of using clang -verify when possible in the
review of r216317.
llvm-svn: 217009
2014-09-03 04:32:08 +00:00
Jonathan Roelofs
c59e585126
Partially address a FIXME in steady_clock::now()
...
http://reviews.llvm.org/D4045
llvm-svn: 216949
2014-09-02 21:14:38 +00:00
Marshall Clow
bbb3a7f51c
Fix PR#20834 - 'is_trivially_destructible yeilds wrong answer for arrays of unknown bound' Thanks to K-ballo for the bug report. Update a few of the other tests while we're here, and fix a typo in a test name.
...
llvm-svn: 216909
2014-09-02 16:19:38 +00:00
Eric Fiselier
1f7bd5f24d
Fix assignments that should be comparisons x3
...
llvm-svn: 216318
2014-08-23 07:55:29 +00:00
Eric Fiselier
67c94867ba
Add return statement to a test class's assignment operator. Defect found by Coverity Scan.
...
llvm-svn: 216317
2014-08-23 06:36:11 +00:00
Eric Fiselier
ca39572270
Add extra test case for PR20345. Should have been commited with r215984
...
llvm-svn: 215985
2014-08-19 16:33:05 +00:00
Eric Fiselier
0acf0d2701
Fix is_member_function_pointer does not account for ellipsis. PR20345. Patch from Agustin Berge.
...
I reviewed the patch and added the test cases.
llvm-svn: 215984
2014-08-19 16:31:47 +00:00
Jonathan Roelofs
f11170406e
Tame a few enum size tests when using -fshort-enums on ARM.
...
llvm-svn: 215769
2014-08-15 21:34:52 +00:00
Marshall Clow
89872e99a5
Fix a problem with reference_wrapper in C++03 that was causing counting predicates to fail. Add a test to make sure it works. However, most of the reference_wrapper tests still fail in C++03 mode, due to a lack of decltype. No change there.
...
llvm-svn: 214760
2014-08-04 19:20:17 +00:00
Eric Fiselier
567bb79bf2
D4451: Fix copy/move issues casude by __tuple_leafs's converting constructor
...
llvm-svn: 213888
2014-07-24 18:48:34 +00:00
Marshall Clow
f52c88f015
Correctly implement LWG 2049; std::is_destructible.
...
llvm-svn: 213163
2014-07-16 15:51:50 +00:00
Marshall Clow
38cae6330b
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.
...
llvm-svn: 212070
2014-06-30 21:27:51 +00:00
Nico Weber
7babe4f074
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.
llvm-svn: 210195
2014-06-04 16:25:58 +00:00
Marshall Clow
2de60eb213
Fix a problem exposed by r208825, which caused bind (and other bits of libc++) to stop working. And tests
...
llvm-svn: 209785
2014-05-29 01:10:28 +00:00
Marshall Clow
85d3e7a729
Fix bug #18350 . Add tests for tuples of all the smart pointers (except auto_ptr)
...
llvm-svn: 207307
2014-04-26 05:19:48 +00:00
Marshall Clow
7546a111a9
Default the copy and move constructors for __tuple_leaf. This fixes bugs 18853 and 19118. Add a test case for that.
...
llvm-svn: 206829
2014-04-21 23:48:09 +00:00
Marshall Clow
5f7c2db2ce
Bug #19473 . If you pass an allocator to std::function, we should use that allocator, not construct one from scratch. Add a test to make sure
...
llvm-svn: 206623
2014-04-18 17:23:36 +00:00
Marshall Clow
b040647672
Fixed a test that was attempting to use rvalue-references w/o checking to see if they were supported in the language. This resulted in a warning when testing using C++03.
...
llvm-svn: 206482
2014-04-17 18:11:38 +00:00
Stephan Tolksdorf
e180ecab2c
[libc++] Teach is_integral, is_[un]signed and make_[un]signed about __[u]int128_t
...
This commit also adds tests for std::numeric_limits<__[u]int128_t>.
Reviewed in http://llvm-reviews.chandlerc.com/D2917
llvm-svn: 204849
2014-03-26 19:45:52 +00:00
Marshall Clow
b33d838bcf
Final bit for LWG #2263 ; test different allocator pointer types. Note that libc++ already does the right thing here; I've just added tests to ensure that it stays this way.
...
llvm-svn: 203539
2014-03-11 04:32:12 +00:00
Marshall Clow
28eded3845
Mark is_final as a C++14 feature.
...
llvm-svn: 202991
2014-03-05 17:58:48 +00:00
Marshall Clow
39bca1ea99
Implement LWG #2212 : std::is_final. This requires compiler support, which modern versions of clang provide. Also mark LWG #2230 as complete - no code changes needed.
...
llvm-svn: 202934
2014-03-05 03:39:25 +00:00
Marshall Clow
4703f76376
Update synposis in <memory> to show move semantics for weak_ptr; add tests for already existing move semantics. Mark LWG issues #2315 (no changes needed), 2316 (move semantics for weak_ptr), 2252 (previous commit) and 2271 (previous commit) as complete.
...
llvm-svn: 202931
2014-03-05 03:12:04 +00:00
Marshall Clow
05c8dad230
Implement LWG Paper n3887: Consistent Metafunction Aliases. This adds std::tuple_element_t<> as an alias for tuple_element<>::type. Clean up the synopsis for tuple_element in <utility> as well.
...
llvm-svn: 202673
2014-03-03 06:18:11 +00:00
Marshall Clow
0d1560e10e
Implement LWG issue 2301: Mark std::tie as constexpr
...
llvm-svn: 202158
2014-02-25 16:11:46 +00:00
Marshall Clow
5bd869490b
Fix for PR17606 - result_of (and INVOKE) works incorrectly for member function pointers with ref qualifiers. Also a drive-by fix for common_type in C++03 mode. Thanks to Michel Morin for the bug report and the proposed fix.
...
llvm-svn: 201101
2014-02-10 17:40:28 +00:00
Peter Collingbourne
a5adf489b7
Const qualify __mem_fn call operator
...
QOI improvement.
Differential Revision: http://llvm-reviews.chandlerc.com/D2059
llvm-svn: 199848
2014-01-22 22:56:52 +00:00
Marshall Clow
7132122196
Fix erroneous test; was failing on darwin-ppc32. Fixes PR18469.
...
llvm-svn: 199542
2014-01-18 03:41:54 +00:00
Marshall Clow
354d39cabc
Add license headers to a bunch of libc++ files that were missing them. No functionality change. Fixes 18291. Thanks to Nico for the bug report and the patch.
...
llvm-svn: 199400
2014-01-16 16:58:45 +00:00
Marshall Clow
c3deeb5f89
Found six (nmostly) identical files named 'test_allocator.h' in the libcxx test suite. Moved one to /support, made it a superset, and removed all but one of the others, and iupdated all the includes. Left the odd one (thread/futures/test_allocator.h) for later.
...
llvm-svn: 196174
2013-12-03 00:18:10 +00:00
Marshall Clow
e7d582a75c
Found two identical files named 'allocators.h' in the libcxx test suite. Moved one to /support, removed the other, and iupdated all the includes. No functionality change
...
llvm-svn: 196127
2013-12-02 18:08:31 +00:00
Marshall Clow
a26fcc7989
Found two identical files named 'DefaultOnly.h' in the libcxx test suite. Moved one to /support, removed the other, and iupdated all the includes. No functionality change
...
llvm-svn: 196118
2013-12-02 17:00:56 +00:00
Marshall Clow
dfdac03c8f
Move <optional> into include/experimental, and into the std::experimental namespace, since it's not part of C++14, but of an upcoming TS
...
llvm-svn: 194867
2013-11-15 22:42:10 +00:00
Howard Hinnant
ccad8c32e0
This fixes a very subtle ABI problem concerning the copy constructor of
...
pair, and a couple of pair-like implementation detail types. The
C++98/03 and 11 standards all specify that the copy constructor of
pair<int, int> is trivial. However as libc++ tracked the draft C++11
standard over the years, this copy constructor became non-trivial, and
then just recently was corrected back to trivial for C++11.
Unfortunately (for libc++1) the Itanium ABI specifies different calling
conventions for trivial and non-trivial copy constructors. Therefore
currently the C++03 libc++ copy constructor for pair<int, int> is ABI
incompatible with the C++11 libc++ copy constructor for pair<int, int>.
This is Bad(tm). This patch corrects the situation by making this copy
constructor trivial in C++03 mode as well.
Just in case it is needed for an incomplete C++11 compiler, libc++
retains the ability to support pair with rvalue references, but without
defaulted special members. However the pair needs non-trivial special
members to implement this special case, (as it did when clang was in
this place a couple of years ago).
During this work a bug was also found and fixed in
is_trivially_constructible.
And there is a minor drive-by fix in <__config> regarding
__type_visibility__.
A test is updated to ensure that the copy constructor of pair<int, int>
is trivial in both C++03 and C++11. This test will necessarily fail for
a compiler that implements rvalue references but not defaulted special
members.
llvm-svn: 194536
2013-11-13 00:39:22 +00:00
Richard Smith
1483143e7a
Avoid using the name 'bzero' for an enumerator in global scope. <strings.h> might declare this as a function.
...
llvm-svn: 193066
2013-10-21 04:59:37 +00:00
Marshall Clow
db78c7049e
Fix LWG Issue 2141: common_type trait produces reference types
...
llvm-svn: 192142
2013-10-07 23:43:33 +00:00
Marshall Clow
4f44079a2c
Apparently, I don't know the difference between 'left' and 'right'. Swap parameters named 'lhs' and 'rhs' so that they correctly refer to the 'left hand side' and 'right hand side' of comparisons. No functionality change. Thanks to Arthur O'Dwyer for pointing this out to me.
...
llvm-svn: 192080
2013-10-07 02:37:18 +00:00
Marshall Clow
d2f095e5ba
Add tests making sure that optional<T>s can be compared at compile time; this functionality was enabled by N3789
...
llvm-svn: 192051
2013-10-05 23:29:16 +00:00
Marshall Clow
dbd2ebb07e
LWG Issue 2247: Implement type trait 'is_null_pointer'
...
llvm-svn: 192049
2013-10-05 21:21:17 +00:00
Marshall Clow
3ceafc7f01
Mark namespaces for user defined literals as 'inline'
...
llvm-svn: 192047
2013-10-05 21:18:32 +00:00
Marshall Clow
de9320aa2b
Implement LWG issue 2275 'forward_as_tuple should be constexpr'
...
llvm-svn: 192038
2013-10-05 18:46:37 +00:00
Marshall Clow
3d5134dd52
Implement n3789; constexpr support in named function objects
...
llvm-svn: 191626
2013-09-28 19:06:12 +00:00
Marshall Clow
5155a569d1
LWG Issue 2148: Hashing Enums
...
llvm-svn: 189831
2013-09-03 17:55:32 +00:00
Marshall Clow
cb2e838ed0
Eradicate tabs
...
llvm-svn: 189808
2013-09-03 14:14:27 +00:00
Howard Hinnant
e7d746d8b9
Implement N3672, optional<T>.
...
llvm-svn: 189772
2013-09-02 20:30:37 +00:00
Howard Hinnant
dda6f242fb
Forgot to svn add the test for r189722.
...
llvm-svn: 189723
2013-08-31 17:03:02 +00:00
Howard Hinnant
69bc206547
SFINAE out duration converting constructor if the constructor would otherwise cause a ratio compile-time overflow. This fixes LWG 2094.
...
llvm-svn: 189722
2013-08-31 16:51:56 +00:00