Commit Graph

633 Commits

Author SHA1 Message Date
Volodymyr Sapsai
e59d098825 Revert "Implement LWG 2221 - No formatted output operator for nullptr."
This reverts r342566 as it causes on bots linker errors like

> Undefined symbols for architecture i386:
>   "std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(std::nullptr_t)", referenced from:


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342599 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-19 23:31:34 +00:00
Marshall Clow
f06032bb0a Implement LWG 2221 - No formatted output operator for nullptr. Reviewed as https://reviews.llvm.org/D44263
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342566 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-19 18:29:57 +00:00
Marshall Clow
1755c75e7e Mark LWG#3102 as complete. No code changes, but I updated a test or two
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342103 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-13 02:23:52 +00:00
Marshall Clow
420ace6f28 Actually mark LWG#2953, don't just say you've done so in r342070
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342071 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 18:53:02 +00:00
Marshall Clow
c106dd615d mark LWG#2953 as complete. No code changes required, but added a couple of extra tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342070 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 18:51:12 +00:00
Marshall Clow
ec25143bbb Implement LWG #3017. list splice functions should use addressof
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342057 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 14:46:17 +00:00
Marshall Clow
e45e0640b6 Mark P0556 as 'in progress'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340752 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-27 16:07:01 +00:00
Marshall Clow
de134800ae Mark LWG#2260 as complete. We already did the right thing, so I just added tests to ensure that we continue to DTRT.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338936 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03 23:28:48 +00:00
Marshall Clow
88f5d7a38b Implement P1023: constexpr comparison operators for std::array
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338668 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-02 02:11:06 +00:00
Marshall Clow
ea96e3a707 Final bit of P0063 - make sure that aligned_alloc is available when the underlying C library supports it
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338457 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-31 23:39:12 +00:00
Eric Fiselier
789c372456 Correctly mark the Filesystem status as complete.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338094 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-27 03:16:02 +00:00
Eric Fiselier
a0866c5fb5 Implement <filesystem>
This patch implements the <filesystem> header and uses that
to provide <experimental/filesystem>.

Unlike other standard headers, the symbols needed for <filesystem>
have not yet been placed in libc++.so. Instead they live in the
new libc++fs.a library. Users of filesystem are required to link this
library. (Also note that libc++experimental no longer contains the
definition of <experimental/filesystem>, which now requires linking libc++fs).

The reason for keeping <filesystem> out of the dylib for now is that
it's still somewhat experimental, and the possibility of requiring an
ABI breaking change is very real. In the future the symbols will likely
be moved into the dylib, or the dylib will be made to link libc++fs automagically).

Note that moving the symbols out of libc++experimental may break user builds
until they update to -lc++fs. This should be OK, because the experimental
library provides no stability guarantees. However, I plan on looking into
ways we can force libc++experimental to automagically link libc++fs.

In order to use a single implementation and set of tests for <filesystem>, it
has been placed in a special `__fs` namespace. This namespace is inline in
C++17 onward, but not before that. As such implementation is available
in C++11 onward, but no filesystem namespace is present "directly", and
as such name conflicts shouldn't occur in C++11 or C++14.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338093 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-27 03:07:09 +00:00
Marshall Clow
d2e2a0206e Mark <span> as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337879 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-25 01:55:25 +00:00
Eric Fiselier
0ddb77a467 Implement filesystem_error::what() and improve reporting.
This patch implements the `what()` for filesystem errors. The message
includes the 'what_arg', any paths that were specified, and the
error code message.

Additionally this patch refactors how errors are created, making it easier
to report them correctly.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337664 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-23 02:00:52 +00:00
Eric Fiselier
e274f439c6 [libc++] Implement Directory Entry Caching -- Sort of.
Summary:
This patch implements directory_entry caching *almost* as specified in P0317r1. However, I explicitly chose to deviate from the standard as I'll explain below.

The approach I decided to take is a fully caching one. When `refresh()` is called, the cache is populated by calls to `stat` and `lstat` as needed.
During directory iteration the cache is only populated with the `file_type` as reported by `readdir`.
The cache can be in the following states:

* `_Empty`: There is nothing in the cache (likely due to an error)
* `_IterSymlink`: Created by directory iteration when we walk onto a symlink only the symlink file type is known.
* `_IterNonSymlink`: Created by directory iteration when we walk onto a non-symlink. Both the regular file type and symlink file type are known.
* `_RefreshSymlink` and `_RefreshNonSymlink`: A full cache created by `refresh()`.  This case includes dead symlinks.
* `_RefreshSymlinkUnresolved`: A partial cache created by refresh when we fail to resolve the file pointed to by a symlink (likely due to permissions). Symlink attributes are cached, but attributes about the linked entity are not.

As mentioned, this implementation purposefully deviates from the standard. According to some readings of the specification, and the Windows filesystem implementation, the constructors and modifiers which don't pass an `error_code` must throw when the `directory_entry` points to a entity which doesn't exist. or when attribute resolution fails for another reason. 

@BillyONeal  has proposed a more reasonable set of requirements, where modifiers other than refresh ignore errors. This is the behavior libc++ currently implements, with the expectation some form of the new language will be accepted into the standard.

Some additional semantics which differ from the Windows implementation:

1. `refresh` will not throw when the entry doesn't exist. In this case we can still meet the functions specification, so we don't treat it as an error.
2. We don't clear the path name when a constructor fails via refresh (this will hopefully be changed in the standard as well).

It should be noted that libstdc++'s current implementation has the same behavior as libc++, except for point (2).

If the changes to the specification don't get accepted, we'll be able to make the changes later.

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0317r1.html

Reviewers: mclow.lists, gromer, ldionne, aaron.ballman

Subscribers: BillyONeal, christof, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337516 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 01:22:32 +00:00
Marshall Clow
1f655099cf Fix HTML blunder
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@336381 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 17:44:12 +00:00
Marshall Clow
64c10d00c3 Implement LWG 2946, 3075 and 3076. Reviewed as https://reviews.llvm.org/D48616
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@336132 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-02 18:41:15 +00:00
Marshall Clow
8d00e543f4 Remove P0771, which was not passed in Rapperswil
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334894 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-16 18:03:29 +00:00
Marshall Clow
385a6d473f Update the to-do list with motions from Rapperswil.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334467 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12 02:45:30 +00:00
Marshall Clow
fa35e8885e Mark more bits of P0433 as complete.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333058 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-23 03:22:59 +00:00
Marshall Clow
faf8db7dfd More notes on Rapperswil issues
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332000 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-10 17:07:38 +00:00
Marshall Clow
5d2e458b6f Status updates for Rapperswil
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@331661 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-07 18:59:04 +00:00
Marshall Clow
6a32b9d38f Update for Rapperswil
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@331638 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-07 14:21:52 +00:00
Marshall Clow
ece1de8658 Mark <span> as "In progress"
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329375 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-06 04:43:27 +00:00
Marshall Clow
0b261846c9 Implement P0754R2: The <version> header.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329075 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-03 15:48:24 +00:00
Eric Fiselier
e96d6a1fb7 Implement P0430R2 - File system library on non-POSIX systems.
This patch implements P0430R2, who's largest change is adding the path::format
enumeration for supporting path format conversions in path constructors.

However, since libc++'s filesystem only really supports POSIX like systems,
there are no real changes needed. This patch simply adds the format enum
and then ignores it when it's passed to constructors.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329031 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-02 23:35:24 +00:00
Eric Fiselier
1e34c76d33 Implement filesystem NB comments, relative paths, and related issues.
This is a fairly large patch that implements all of the filesystem NB comments
and the relative paths changes (ex. adding weakly_canonical). These issues
and papers are all interrelated so their implementation couldn't be split up
nicely.

This patch upgrades <experimental/filesystem> to match the C++17 spec and not
the published experimental TS spec. Some of the changes in this patch are both
API and ABI breaking, however libc++ makes no guarantee about stability for
experimental implementations.

The major changes in this patch are:

* Implement NB comments for filesystem (P0492R2), including:
  * Implement `perm_options` enum as part of NB comments, and update the
    `permissions` function to match.
  * Implement changes to `remove_filename` and `replace_filename`
  * Implement changes to `path::stem()` and `path::extension()` which support
    splitting examples like `.profile`.
  * Change path iteration to return an empty path instead of '.' for trailing
    separators.
  * Change `operator/=` to handle absolute paths on the RHS.
  * Change `absolute` to no longer accept a current path argument.

* Implement relative paths according to NB comments (P0219r1)

* Combine `path.cpp` and `operations.cpp` since some path functions require
  access to the operations internals, and some fs operations require access
  to the path parser.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329028 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-02 23:03:41 +00:00
Marshall Clow
256f187bc6 Implement LWG3034: P0767R1 breaks previously-standard-layout types
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328064 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21 00:36:05 +00:00
Marshall Clow
6ce040b9aa Updated C++2a status with changes from Jacksonville WG21 meeting
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@327806 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-18 19:29:21 +00:00
Marshall Clow
46b8a51b49 Implement LWG#2518 - Non-member swap for propagate_const should call member swap
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@327005 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08 15:01:50 +00:00
Marshall Clow
06ac7cdfc7 Implement P0767R1 - Deprecate POD
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@326801 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-06 15:01:19 +00:00
Marshall Clow
f31b30dc55 Added P0805 to the list of ready bits
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@326485 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-01 21:16:07 +00:00
Marshall Clow
806a6ec645 Implement LWG 2835 - fix <tgmath.h>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324923 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-12 19:13:24 +00:00
Marshall Clow
f72f21907c Implement LWG#2908 - The less-than operator for shared pointers could do more, and mark 2878 as complete as well (we already do that)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324911 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-12 17:26:40 +00:00
Eric Fiselier
0fc3d1264c Mark two issues as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324852 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-11 21:57:25 +00:00
Marshall Clow
1a2caf573f Update the status of removed components
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324609 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-08 14:51:22 +00:00
Marshall Clow
5b1e87e52d Implement deduction guide for basic_string as described in P0433
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324569 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-08 06:34:03 +00:00
Marshall Clow
f003d63c40 Comment on 'Review' issues
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324503 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-07 19:24:37 +00:00
Marshall Clow
c387931db5 Mark P0777 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324399 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 21:00:58 +00:00
Marshall Clow
46c8ec503e No, really this time mark 3034 as 'Patch Ready'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324312 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 03:24:21 +00:00
Marshall Clow
4d839cb37e Mark issue 3034 as 'Patch Ready'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324310 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 03:23:16 +00:00
Marshall Clow
6c83c7ff6f More patches ready
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324307 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 01:59:28 +00:00
Marshall Clow
53095c7200 Add issues in 'Review'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324292 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-05 23:50:49 +00:00
Eric Fiselier
88232b14d4 Mark LWG 3014 as complete. No code changes needed
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324193 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 07:37:09 +00:00
Eric Fiselier
4d0f42850b Implement LWG 3014 - Fix more noexcept issues in filesystem.
This patch removes the noexcept declaration from filesystem
operations which require creating temporary paths or
creating a directory iterator. Either of these operations
can throw.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324192 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 07:35:36 +00:00
Eric Fiselier
b2c07b0af2 Mark LWG 3013 as already complete. See r316941
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324191 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 07:29:53 +00:00
Eric Fiselier
0b47a655ac Implement LWG2989: path's streaming operators allow everything under the sun.
Because path can be constructed from a ton of different types, including string
and wide strings, this caused it's streaming operators to suck up all sorts
of silly types via silly conversions. For example:

using namespace std::experimental::filesystem::v1;
std::wstring w(L"wide");
std::cout << w; // converts to path.

This patch tentatively adopts the resolution to LWG2989 and fixes the issue
by making the streaming operators friends of path.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324189 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 03:10:53 +00:00
Eric Fiselier
cc7688a719 Mark issue 2851 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324188 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 02:45:33 +00:00
Eric Fiselier
af1fd7c75f Address LWG 2849 and fix missing failure condition in copy_file.
Previously copy_file didn't handle the case where the input and
output were the same file.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324187 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 02:43:32 +00:00
Marshall Clow
37e4c9b159 Implement LWG2870: Default value of parameter theta of polar should be dependent
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323918 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-31 21:42:39 +00:00