Commit Graph

4452 Commits

Author SHA1 Message Date
Eric Fiselier
4746c1ee00 Fix installation of cxxabi.h through libc++.
Previously, the install command for the cxxabi headers specified
the wrong component, and therefore they were not being included
in the install-cxx command.

This patch corrects the component name.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318989 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-25 23:39:17 +00:00
Marshall Clow
0140bb8196 Update C++2a status and add Glen to CREDITS.TXT. Reviewed as https://reviews.llvm.org/D40379
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318919 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 14:50:56 +00:00
Martin Storsjo
9de8659223 Allow to set locale on Windows.
Fix the problem PR31516 with setting locale on Windows by wrapping
_locale_t with a pointer-like class.

Reduces 74 test failures in std/localization test suite to 47 test
failures (on llvm clang, Visual Studio 2015). Number of test failures
doesn't depend on the platform (x86 or x64).

Patch by Andrey Khalyavin.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318902 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 10:38:18 +00:00
Marshall Clow
389f90f5d7 Add additional 'UNSUPPORTED' to the test case.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318897 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 05:43:25 +00:00
Marshall Clow
70c7bbd04f Add [[nodiscard]] to std::async as part of P0600.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-23 01:25:03 +00:00
Eric Fiselier
18a2685809 [libcxx] Implement std::to_address for C++20
Summary: Now implements P0653R2 - Utility to convert to raw pointer.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 19:49:21 +00:00
Marshall Clow
aa0e236289 Implement p0137r1 - std::launder. Reviewed as https://reviews.llvm.org/D40144
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 19:49:03 +00:00
Volodymyr Sapsai
bd858589df [libcxx][fixup] Mark std::basic_istream::getline tests as failing for previous libcxx versions.
r318862 added a fix for 0-termination input array in case of an error. Previous
libcxx versions don't have the fix and corresponding tests should be failing.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 19:36:54 +00:00
Volodymyr Sapsai
2744cdf509 [libcxx] Make std::basic_istream::getline 0-terminate input array in case of error.
It covers the cases when the sentry object returns false and when an exception
was thrown. Corresponding standard paragraph is C++14 [istream.unformatted]p21:
  In any case, if n is greater than zero, it then stores a null character
  (using charT()) into the next successive location of the array.

Patch by Reimar Döffinger.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318862 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 18:52:36 +00:00
Billy Robert O'Neal III
f27631034a Add another test_macros.h include I missed to tuple.by.type.pass.cpp
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318830 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 12:29:17 +00:00
Marshall Clow
67e20f21d4 Add some tests for operations on const associative containers. Part of LWG#2542
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318818 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 06:02:27 +00:00
Billy Robert O'Neal III
9af08238a7 Replace assert(true) in tests with actual asserts. Reviewed as https://reviews.llvm.org/D40324
In a17cd7c641 Marshall added assert(true) to the vector<bool>::size tests, which break on C1XX:

D:\Contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(62): error C2220: warning treated as error - no 'object' file generated
d:\contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(33) : warning C6326: Potential comparison of a constant with another constant.
d:\contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(52) : warning C6326: Potential comparison of a constant with another constant.

The corresponding test for vector::size asserts assert(c.size() == 3);, so I changed it to do that here.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318812 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-21 23:03:02 +00:00
Martin Storsjo
abba9f214b Remove a broken win32 locale function redirection
One can't replace vsscanf(_l) with a sscanf(_l) that doesn't
take a va_list.

This has been untouched since it was added in SVN r140728, so
apparently it hasn't been used since. One reason for this mistake
originally might have been that there was no _vsscanf_l until MSVC
2015.

Since it's unused, just remove this define.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318810 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-21 22:41:15 +00:00
Billy Robert O'Neal III
37332d7724 Add missing test_macros.h inclusion.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318808 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-21 22:16:57 +00:00
Billy Robert O'Neal III
7e250fcdc1 Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318804 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-21 21:37:26 +00:00
Eric Fiselier
10bebe2053 Fix std::string::data() symbol during library build.
The non-const data() member of std::string is only exposed
in C++17 and beyond. However std::string is externally instantiated
and so the member function needs to be exposed to be externally instantiated.

On Linux and OS X this shouldn't cause a problem, because
_LIBCPP_INLINE_VISIBILITY ensures the symbol is always inlined.

However on Windows, the symbol gets marked dllimport, but
there is no definition to import, causing link errors.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318690 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-20 20:23:27 +00:00
Eric Fiselier
7228160964 Attempt to fix template depth test failures on older Clang versions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318625 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-19 09:46:34 +00:00
Eric Fiselier
d316c2b7fc Fix min/max usage in variant
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318622 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-19 04:57:22 +00:00
Eric Fiselier
e7f8cd476d [libc++] Shrink variant's index type when possible
Summary:
Currently `std::variant` always uses an unsigned int to store the variant index. However this isn't nessesary and causes `std::variant` to be larger than it needs to be in most cases.

This patch changes the index type to be `unsigned char` when possible, and `unsigned short` or `unsigned int` otherwise, depending on the size (Although it's questionable if it's even possible to create a variant with 65535 elements.

Unfortunately this change is an ABI break, and as such is only enabled in ABI v2.

Reviewers: mpark

Reviewed By: mpark

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318621 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-19 04:19:44 +00:00
Eric Fiselier
115071a08e Fix nodiscard test when modules are enabled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318618 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-19 03:50:35 +00:00
Marshall Clow
4bf7f4c1e8 Mark free functions size/empty/data conditionally noexcept.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318432 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 17:55:41 +00:00
Marshall Clow
bc6989bcbd More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in filesystem::path
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318378 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 05:48:32 +00:00
Marshall Clow
79f3f9dbed More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in match_results. <regex>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318375 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 04:48:34 +00:00
Marshall Clow
f1729d90b3 More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in string, string_view, and the free function std::empty(). Removed tabs from <string_view>, which is why the diff is so big.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318328 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 20:02:27 +00:00
Casey Carter
3fdfbbfe34 [test] Alignment must be > __STDCPP_DEFAULT_NEW_ALIGNMENT__ to call aligned new
Differential Revision: D39221

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318325 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 19:14:45 +00:00
Marshall Clow
37b5a6b495 Clean up the tests for free data(), size() and empty()
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318313 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 17:47:09 +00:00
Billy Robert O'Neal III
b981667776 Tolerate even more [[nodiscard]] in the STL. Reviewed as https://reviews.llvm.org/D39080
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318277 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 07:45:07 +00:00
Billy Robert O'Neal III
9ae62c79cc Tolerate [[nodiscard]] annotations in the STL. Reviewed as https://reviews.llvm.org/D39033
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318276 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 07:40:37 +00:00
Marshall Clow
88626bf496 First part of P0600 - '[[nodiscard] in the standard library'. Mark the 'empty()' methods of all the containers as nodiscard. If you're calling empty() w/o looking at the result, you probably meanto to call 'clear()'. c++2a only
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318269 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 05:51:26 +00:00
Marshall Clow
2645a49a67 Still more missing tests - this time for the unordered containers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318268 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 05:25:36 +00:00
Marshall Clow
0b07da7c85 Named the macro wrong in the test.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318259 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 03:08:39 +00:00
Marshall Clow
4f009913df More missing tests - array<>::size() and array<>::max_size()
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 02:31:14 +00:00
Eric Fiselier
6f8459857e Update Appveyor LLVM install link to be current and non-broken
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318247 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 01:37:11 +00:00
Marshall Clow
a17cd7c641 Added tests for xxx.size() and xxx.empty() for all the sequence containers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318244 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 01:33:33 +00:00
Marshall Clow
c9f5f10562 Add two new macros: _LIBCPP_NODISCARD_AFTER_CXX17 and _LIBCPP_CONSTEXPR_AFTER_CXX17, along with a way to turn off the NODISCARD one: _LIBCPP_DISABLE_NODISCARD_AFTER_CXX17. No one is using these yet, but we will be ... soon
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318208 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 22:26:50 +00:00
Alexander Richardson
e208d0895a Rename identifiers named __output
Summary:
In the CHERI clang compiler __output and __input are keywords and therefore
we can't compile libc++ with our compiler.

Reviewers: mclow.lists, EricWF, theraven

Reviewed By: EricWF

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318144 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 11:14:25 +00:00
Marshall Clow
8437dbd021 Another test for LWG2952
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318126 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 01:18:36 +00:00
Marshall Clow
52728778fa Implement LWG2950: std::byte operations are misspecified
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318125 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 01:14:53 +00:00
Marshall Clow
e1cfe7a7f6 Implement LWG2952: iterator_traits should work for pointers to cv T
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318119 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 00:03:10 +00:00
Marshall Clow
928f2866ec Put the status in the wrong column
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318012 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 04:15:39 +00:00
Marshall Clow
edd7e051d4 Implement P0550R2: Transformation Trait remove_cvref
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318011 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 03:59:22 +00:00
Marshall Clow
7513814cb6 Two more papers from Albuquerque
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318000 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-12 18:52:16 +00:00
Marshall Clow
55eda5dfcc Updated C++2a status page with new features/defects approved in Albuquerque.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317996 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-12 18:48:42 +00:00
Alex Lorenz
b4a34c08ac Add _LIBCPP_INLINE_VISIBILITY to __compressed_pair_elem members
The commit r300140 changed the implementation of compressed_pair, but didn't add
_LIBCPP_INLINE_VISIBILITY to the constructors and get members of the
compressed_pair_elem class. This patch adds the visibility annotation.

I didn't find a way to test this change with libc++ regression tests.

rdar://35352579

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09 17:54:49 +00:00
Volodymyr Sapsai
eada02443a [libcxx] Mark test cxa_deleted_virtual.pass.cpp as failing for previous libcxx versions.
r313500 added a fix for undefined "___cxa_deleted_virtual" symbol.
Previous libcxx versions don't have the fix and corresponding test
should be failing.

rdar://problem/34521053

Reviewers: EricWF, mclow.lists, ahatanak

Reviewed By: ahatanak

Subscribers: mehdi_amini, cfe-commits

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



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317734 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08 22:30:29 +00:00
Marshall Clow
56a3f4a9d1 Added include for <cassert>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317722 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08 20:25:47 +00:00
Eric Fiselier
7e73ea873f Teach test suite about C++2a dialect flag.
This patch teaches the test suite configuration about the -std=c++2a
flag. And, since it's the newest dialect, change the test suite to
choose it, if possible, by default.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317611 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07 20:26:23 +00:00
Eric Fiselier
6efb1c19a7 Change test suite to support c++17 dialect flag instead of c++1z.
This patch changes the test suite to attempt and prefer -std=c++17 over
-std=c++1z. It also fixes the REQUIRES and UNSUPPORTED lit markers
to refer to c++17 over c++1z.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317610 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07 20:20:58 +00:00
Marshall Clow
2e390822e5 Change a bunch of comments from C++1z to C++17. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317212 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-02 15:03:25 +00:00
Roger Ferrer Ibanez
79078a328e Mark tests as unsupported in C++98 as well
Differential Revision: https://reviews.llvm.org/D38362



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317210 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-02 15:01:43 +00:00