Commit Graph

359 Commits

Author SHA1 Message Date
Casey Carter
8b30287098 optional: Implement LWG 2900 and P0602
Differential Revision: https://reviews.llvm.org/D32385

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@307505 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-09 17:15:49 +00:00
Eric Fiselier
b2e9337b06 Fix filesystem build on platforms with weird time_t types.
32-bit powerpc provides a 64 bit time_t type and older ppc64 systems
provide time_t as a floating point type. This caused problems when building
operations.cpp since operations.cpp contained compile time tests for conversions
between time_t and filesystem time type.

When these tests failed they caused the libc++ build to fail as well. This is unfortunate.

This patch moves the tests out of the source file and into the test suite. It also
expands the tests to allow testing of the weird time_t configurations on all platforms.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@307461 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-08 04:18:41 +00:00
Duncan P. N. Exon Smith
e452f6a7e3 cmath: Support clang's -fdelayed-template-parsing
r283051 added some functions to cmath (in namespace std) that have the
same name as functions in math.h (in the global namespace).  Clang's
limited support for `-fdelayed-template-parsing` chokes on this.  Rename
the ones in `cmath` and their uses in `complex` and the test.

rdar://problem/32848355

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@307357 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 05:13:36 +00:00
Eric Fiselier
73202133d9 Allow the libc++ C header wrappers to be included when compiling C.
C99 at least. C89 still fails due to the use of block comments.

NOTE: Having libc++ on the include path when compiling C is not
recommended or ever really supported. However it happens often
enough that this change is warrented.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305539 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-16 01:57:41 +00:00
Eric Fiselier
63e0adbe3a Fix another test with modules enabled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305448 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 03:03:45 +00:00
Eric Fiselier
8c6e35cf2c Fix test when modules are enabled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305445 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 02:54:12 +00:00
Michael Park
eaa74739c0 Mark __is_inplace_* tests as UNSUPPORTED in <= C++14.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305373 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 07:12:55 +00:00
Michael Park
c590dae5d6 Add an __is_inplace_index metafunction.
Summary: This is used to constrain `variant`'s converting constructor correctly.

Reviewers: EricWF, mclow.lists

Reviewed By: EricWF, mclow.lists

Differential Revision: https://reviews.llvm.org/D34111

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305370 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 05:51:18 +00:00
Marshall Clow
3128b5abf0 Mark the recent variant test as UNSUPPORTED for C++ before 17
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305198 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 16:33:41 +00:00
Marshall Clow
bc37f8d93d Make tuple_element static_assert in pair if the index is out of range. Also, add a message to variant_alternative<> in the similar case (it already asserted). Add tests for this
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305196 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 16:13:17 +00:00
Casey Carter
3da9072b08 [test] Test changes to accommodate LWG 2904 "Make variant move-assignment more exception safe"
Also: Move constexpr / triviality extension tests into the std tree and make them conditional on _LIBCPP_VERSION / _MSVC_STL_VERSION.

https://reviews.llvm.org/D32671

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304847 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:06:04 +00:00
Marshall Clow
118d2fef02 Fix the recently introduced test to work on C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304629 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 01:21:29 +00:00
Marshall Clow
b1d8bca727 Fix some undefined behavior in __hash_table. Thanks to vsk for the report and the patch. Reviewed as https://reviews.llvm.org/D33588.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304617 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:08:32 +00:00
Eric Fiselier
01e23b3a4b Fix name used in -verify diagnostic to match trunk
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304384 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 02:31:01 +00:00
Eric Fiselier
018a3d51a4 [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows
Summary:
This patch improves how libc++ handles min/max macros within the headers. Previously libc++ would undef them and emit a warning.
This patch changes libc++ to use `#pragma push_macro`  to save the macro before undefining it, and `#pragma pop_macro` to restore the macros and the end of the header.

Reviewers: mclow.lists, bcraig, compnerd, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits, krytarowski

Differential Revision: https://reviews.llvm.org/D33080

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304357 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 22:07:49 +00:00
Eric Fiselier
0a8dab6dc6 Fix multiple bugs in coroutine tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304124 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 05:00:24 +00:00
Eric Fiselier
1e9e38539a Remove XFAIL's for recently fixed bug
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304102 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 20:25:41 +00:00
Eric Fiselier
a317745593 Workaround debug info bug in Clangs coroutine implementation
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303966 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 04:09:38 +00:00
Eric Fiselier
4aec787d15 Get <experimental/coroutine> working in C++03.
Clang supports coroutines in all dialects; Therefore libc++ should too,
otherwise the Clang extension is unusable.

I'm not convinced extending support to C++03 is a feasible long term
plan, since as the library grows to offer things like generators it
will be come increasingly difficult to limit the implementation to C++03.

However for the time being supporting C++03 isn't a big deal.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303963 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 03:02:54 +00:00
Erik Pilkington
3a07dd740b Fix a test that was failing in C++11 mode introduced in r303874
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 16:16:17 +00:00
Erik Pilkington
a3e0bf4396 Add support for shared_ptr<FunctionType>
Fixes PR27566.

Differential revision: https://reviews.llvm.org/D30837

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303874 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 15:43:31 +00:00
Eric Fiselier
737c3bf25e Add <experimental/coroutine>
This patch adds the library portions of the coroutines PDTS,
which should now be supported by Clang.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303836 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 04:36:24 +00:00
Erik Pilkington
64182a5877 [test] Add support for Objective-C++ tests
Differential revision: https://reviews.llvm.org/D33049

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303466 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-19 23:02:49 +00:00
Eric Fiselier
e250cc68ce Cleanup test issues reported by STL @ Microsoft.
This patch cleans up a number of issues reported by STL, including:

1) Fix duplicate is_convertible test.
2) Move non-standard reference_wrapper tests under test/libcxx
3) Fix assumption that sizeof(wchar_t) == 32 in the codecvt and
   wstring_convert tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 03:38:28 +00:00
Eric Fiselier
8e7fc5f6b3 Move POSIX specific test under test/libcxx subdirectory
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 02:02:09 +00:00
Eric Fiselier
b22e6987b8 Move tests for libc++ configurations into libcxx/ test subdirectory
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 01:49:32 +00:00
Eric Fiselier
2d31e197db Fix or move tests with non-standard assumptions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302862 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 01:44:51 +00:00
Eric Fiselier
78f5dc09ca [libc++] Implement exception_ptr on Windows
Summary:
This patch implements exception_ptr on Windows using the `__ExceptionPtrFoo` functions provided by MSVC.

The `__ExceptionPtrFoo` functions are defined inside the C++ standard library, `msvcprt`, which is unfortunate because it requires libc++ to link to the MSVC STL. However this doesn't seem to cause any immediate problems. However to be safe I kept all usages within the libc++ dylib so that user programs wouldn't have to link to MSVCPRT as well.

Note there are still 2 outstanding exception_ptr/nested_exception test failures.

* `current_exception.pass.cpp` needs to be rewritten for the Windows exception_ptr semantics which copy the exception every time.
* `rethrow_if_nested.pass.cpp` need investigation. It hits a stack overflow, likely from recursion.

This patch also gets most of the `<future>` tests passing as well.

Reviewers: mclow.lists, compnerd, bcraig, rmaprath, majnemer, BillyONeal, STL_MSFT

Subscribers: mgorny, cfe-commits

Differential Revision: https://reviews.llvm.org/D32927

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302393 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 01:17:50 +00:00
Mehdi Amini
907c1196a7 Add markup for libc++ dylib availability
Libc++ is used as a system library on macOS and iOS (amongst others). In order
for users to be able to compile a binary that is intended to be deployed to an
older version of the platform, clang provides the
availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_
that can be placed on declarations to describe the lifecycle of a symbol in the
library.

See docs/DesignDocs/AvailabilityMarkup.rst for more information.

Differential Revision: https://reviews.llvm.org/D31739

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302172 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-04 17:08:54 +00:00
Stephan T. Lavavej
559442652c [libcxx] [test] Strip trailing whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302105 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-04 01:43:58 +00:00
Eric Fiselier
9f6e23c7c9 update XFAIL comments with more details
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300944 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 03:09:40 +00:00
Eric Fiselier
c94dd0a571 XFAIL Windows test failures under test/libcxx
This patch XFAIL's a number of tests under test/libcxx when on Windows.
These failures need more investigation or patches to either Clang or libc++
but for now we don't want them to prevent the bot from going green.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300941 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 01:48:02 +00:00
Eric Fiselier
869c5adc90 Cleanup _LIBCPP_HAS_NO_<c++11-feature> in support headers and final tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300637 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 01:02:49 +00:00
Marshall Clow
059256914c Remove the binders from C++17. Reviewed as https://reviews.llvm.org/D31769
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300232 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 18:25:32 +00:00
Eric Fiselier
706e2c7374 Diagnose when reverse_iterator is used on path::iterator.
path::iterator isn't a strictly conforming iterator. Specifically
it stashes the current element inside the iterator. This leads to
UB when used with reverse_iterator since it requires the element
to outlive the lifetime of the iterator.

This patch adds a static_assert inside reverse_iterator to disallow
"stashing iterator types", and it tags path::iterator as such a type.

Additionally this patch removes all uses of reverse_iterator<path::iterator>
within the tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300164 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 02:54:13 +00:00
Eric Fiselier
3b7f79609f Update tests -verify error messages after r300140.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300156 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 01:03:41 +00:00
Eric Fiselier
7b41c797ba [libc++] Implement LWG 2911 - add an is_aggregate type-trait
Summary:
This patch implements http://cplusplus.github.io/LWG/lwg-defects.html#2911.

I'm putting this up for review until __is_aggregate is added to clang (See D31513)

Reviewers: mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D31515

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300126 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 23:08:46 +00:00
Marshall Clow
59bcc879ab Implement Pp0156r2: 'Variadic Lock Guard, version 5' Reviewed as https://reviews.llvm.org/D31163.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@298681 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 03:40:36 +00:00
Marshall Clow
03b862f6ea Remove random_shuffle in C++17. Please use shuffle instead. If you have to, you cant get it back by defining _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE before including any libc++ headers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@298597 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-23 13:43:37 +00:00
Eric Fiselier
c1b1d7f0bb Fix hash requirements check in __hash_table.
r296565 attempted to add better diagnostics when an unordered container
is instantiated with a hash that doesn't meet the Hash requirements.

However I mistakenly checked the wrong set of requirements. Specifically
it checked if the hash met the requirements for specializations of
std::hash. However these requirements are stricter than the generic
Hash requirements.

This patch fixes the assertions to only check the Hash requirements.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296919 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-03 22:35:58 +00:00
Eric Fiselier
92dbfc48cc remove max_size() extension from polymorphic_allocator. It is unneeded
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296831 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 22:10:14 +00:00
Mehdi Amini
d3acadce0c Fix Apple-specific XFAIL directive in libc++ test
These tests are failing in XCode 8.0, 8.1, and 8.2, but not in Xcode
8.3. Annoyingly the version numbering for clang does not follow Xcode
and is bumped to 8.1 only in Xcode 8.3. So Xfailing apple-clang-8.0
should catch all cases here.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296704 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 23:14:34 +00:00
Eric Fiselier
0987c0c391 Mark test as unsupported in C++11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296571 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 02:52:04 +00:00
Eric Fiselier
c6422362d5 Improve diagnostics when an invalid hash is used in an unordered container.
This patch adds a static assertion that the specified hash meets
the requirements of an enabled hash, and it ensures that the static
assertion is evaluated before __compressed_pair is instantiated.
That way the static assertion diagnostic is emitted first.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296565 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 02:02:28 +00:00
Saleem Abdulrasool
524f109550 test: explicitly size enumeration
On certain targets, enumerations may be smaller than an `unsigned long`.
Use an explicitly sized enumeration.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295558 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-18 19:28:36 +00:00
Eric Fiselier
6ebcc5c9c4 Add doc for _LIBCPP_ENABLE_CXX17_DISABLED_AUTO_PTR and make it work under _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295407 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 03:30:25 +00:00
Eric Fiselier
515ba559b9 [libcxx] Remove unexpected handlers in C++17
Summary:
This patch implements [P0003R5](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html) which removes exception specifications from C++17.

The only changes to the library are removing `set_unexpected`, `get_unexpected`, `unexpected`, and `unexpected_handler`. These functions can be re-enabled in C++17 using `_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS`.

@mclow.lists what do you think about removing stuff is this way?

Reviewers: mclow.lists

Reviewed By: mclow.lists

Subscribers: mclow.lists, cfe-commits

Differential Revision: https://reviews.llvm.org/D28172

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295406 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 03:25:08 +00:00
Saleem Abdulrasool
7f5b63b5c4 test: mark another test as requiring pthreads
This is checking pthread specific behaviour.  Add a requirement on
pthreads.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294956 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13 15:26:47 +00:00
Saleem Abdulrasool
4aac249f71 test: XFAIL windows for non-portable test
This test validates that the lock_guard is declared variadically across
C++03 and C++11.  Given the lack of stable ABI on Windows and the fact
that the RTTI encoding on Windows is different, XFAIL it on that target.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294720 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 06:51:21 +00:00
Saleem Abdulrasool
74ec9d7947 test: fix test under Windows
When running the test under clang-cl, we do not report `__GNUC__`, which
is needed to supress the warnings which are being treated as errors.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294719 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 06:51:19 +00:00