| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
llvm-svn: 294393
|
| |
|
|
|
|
| |
internals
llvm-svn: 294391
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recently I turned on libc++'s debug mode assertions when
CMake is configured with -DLIBCXX_ENABLE_ASSERTIONS=ON. This
change exposed assertion failures caused by bugs in filesystem.
This patch fixes those failures.
The first bug was that `PathParser` was using front()/back()
on empty string views in order to get the address of the character.
However this is UB on empty strings. Those operations now use data()
to obtain the pointer.
The second bug was that directory_iterator attempted to capture errno when it
was unset and there was an assertion to detect this.
llvm-svn: 294360
|
| |
|
|
| |
llvm-svn: 294355
|
| |
|
|
| |
llvm-svn: 294353
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: EricWF
Reviewed By: EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D29209
llvm-svn: 294350
|
| |
|
|
|
|
| |
in c++17. Use shuffle() instead. No change to libc++, just the tests.
llvm-svn: 294328
|
| |
|
|
| |
llvm-svn: 294311
|
| |
|
|
|
|
|
|
| |
This really should get identified properly by the compiler to convert to
a NVRO, but compress the code anyways. This makes the implementation
identical to directory_iterator.cpp
llvm-svn: 294270
|
| |
|
|
|
|
| |
change.
llvm-svn: 294194
|
| |
|
|
| |
llvm-svn: 294190
|
| |
|
|
| |
llvm-svn: 294189
|
| |
|
|
|
|
|
|
|
| |
Replace preprocess conditions of defined(_MSC_VER) &&
!defined(__clang__) with defined(_LIBCPP_MSVC). NFC.
Patch by Dave Lee!
llvm-svn: 294171
|
| |
|
|
| |
llvm-svn: 294167
|
| |
|
|
|
|
|
|
| |
In addition to the PR for LWG 2773 this patch also ensures
that each of std::ignores constructors or assignment operators
are constexpr.
llvm-svn: 294165
|
| |
|
|
|
|
| |
No functional change, no code review.
llvm-svn: 294161
|
| |
|
|
|
|
| |
No functional change, no code review.
llvm-svn: 294160
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When compiled with Clang for Windows, this was emitting "enumerator value
evaluates to 4294967295, which cannot be narrowed to type 'int' [-Wc++11-narrowing]".
The test should more strenuously avoid poking this ABI deficiency (and it
already has coverage for explicitly specified underlying types).
Fixes D29140.
llvm-svn: 294159
|
| |
|
|
|
|
|
|
|
|
| |
prevents copy elision".
N4618 30.6.6 [futures.unique_future]/12 declares "shared_future<R> share() noexcept;".
Fixes D29139.
llvm-svn: 294158
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libcxx's tests use various C Standard Library functions that have been
marked by MSVC's CRT as deprecated by Microsoft (not by ISO).
libcxx's usage is cromulent (just checking with decltype to see if the functions
are being dragged in by various headers as required by the Standard), so
defining _CRT_SECURE_NO_WARNINGS will silence the warnings in a targeted manner.
This needs to be defined before including any CRT headers.
Also, make this file prettier.
Fixes D29138.
llvm-svn: 294157
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
test/std/strings/string.classes/typedefs.pass.cpp
Actually test what basic_string's typedefs stand for.
test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
NotDerived and ND were completely unused.
test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
P2 was mistakenly not being used. Yes, that's
right: -Wunused-local-typedef CAUGHT A MISTAKE! AMAZING!
Fixes D29137.
llvm-svn: 294156
|
| |
|
|
|
|
|
|
| |
These typedefs were completely unused.
Fixes D29136.
llvm-svn: 294155
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Guard typedefs and static_asserts with _LIBCPP_VERSION.
test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
Additionally deal with conditional compilation.
test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
Additionally deal with typedefs used by other typedefs.
Fixes D29135.
llvm-svn: 294154
|
| |
|
|
|
|
| |
noexcept by default, so it's not really needed, but the other exception classes have the _NOEXCEPT, and gcc complains if these are missing. I think we should remove them all - but not today.
llvm-svn: 294142
|
| |
|
|
| |
llvm-svn: 294141
|
| |
|
|
| |
llvm-svn: 294139
|
| |
|
|
| |
llvm-svn: 294138
|
| |
|
|
|
|
| |
change, and is in response to http://http://wg21.link/LWG2806, which I *expect* to be adopted in Kona. I am making this change now in anticipation, and will get it into 4.0, because (a) 4.0 is the first release with std::optional, and (b) I don't want to make an ABI-change later, when the user base should be significantly larger. Note that I didn't change std::experimental::bad_optional_access, because that's still specified to derive from std::logic_error.
llvm-svn: 294133
|
| |
|
|
|
|
|
|
|
| |
N4100 states that an error shall be reported if
`!exists(p) || !is_directory(p)`. We were missing the first half of the
conditional. Invert the error and normal code paths to make the code
easier to follow.
llvm-svn: 294127
|
| |
|
|
| |
llvm-svn: 294116
|
| |
|
|
| |
llvm-svn: 294115
|
| |
|
|
|
|
|
|
|
|
| |
It is my opinion that libc++ should never use `<cassert>`, including in the `dylib`.
This patch remove all uses of `assert` from within libc++ and replaces most of them with `_LIBCPP_ASSERT` instead.
Additionally this patch turn `LIBCXX_ENABLE_ASSERTIONS` off by default,
because the standard library should not be aborting user programs unless explicitly asked to.
llvm-svn: 294107
|
| |
|
|
| |
llvm-svn: 294106
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Visible definitions for basic_string::assign are sometimes emitted in
the dylib depending on the version of LLVM used to compile libc++.
This can cause the check-cxx-abilist target to fail.
This patch attempts marks the basic_string::assign templates as inline
to prevent this. That way the export list is consistent across LLVM
versions.
llvm-svn: 294100
|
| |
|
|
| |
llvm-svn: 294099
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
num_put::put uses %p for pointer types, but the exact format of %p is
implementation defined behavior for the C library. Compare output to
snprintf for portability.
Reviewers: EricWF, mclow.lists
Reviewed By: EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D29197
llvm-svn: 293926
|
| |
|
|
|
|
| |
NFC.
llvm-svn: 293881
|
| |
|
|
| |
llvm-svn: 293623
|
| |
|
|
| |
llvm-svn: 293619
|
| |
|
|
| |
llvm-svn: 293599
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While this change didn't really hurt, it does lead to spurious
warnings about not being able to override weak symbols if you end up
linking objects built with this change to ones built without it.
Furthermore, since __call_once_proxy is called indirectly anyway it
doesn't actually inline ever.
Longer term, it would probably make sense to give this symbol internal
visibility instead.
This reverts r291497
llvm-svn: 293581
|
| |
|
|
|
|
|
| |
Use the _LIBCPP_WIN32API macro instead of _WIN32 checks. Fix a missed
renaming for style conformance.
llvm-svn: 293543
|
| |
|
|
|
|
|
|
|
| |
This adds a basic first cut implementation for directory_iterator on
Windows. It uses the FindFirstFile/FindNextFile which has the same
restrictions as opendir/readdir where there exists a TOCTOU race
condition.
llvm-svn: 293531
|
| |
|
|
|
|
|
| |
The directory_iterator implementation file was missing the file header.
Add one. NFC.
llvm-svn: 293530
|
| |
|
|
|
|
|
|
|
|
| |
These member functions were decorated with `_LIBCPP_FUNC_VIS` when the
class is also decorated with external visibility. This breaks down when
building for PE/COFF, where the member function cannot be decorated if
it is within a decorated class. The class attribute will propagate to
the member. Remove the extraneous decoration.
llvm-svn: 293454
|
| |
|
|
|
|
|
| |
The typedef is not particularly long, and used in exactly one location.
Just spell it out at the site. NFC.
llvm-svn: 293450
|
| |
|
|
|
|
|
|
| |
Microsoft's SAL has a `__deref` macro which results in a compilation
failure when building the filesystem module on Windows. Rename the
member function internally to avoid the conflict.
llvm-svn: 293449
|
| |
|
|
|
|
|
| |
This template was defined inline, within the TU only and had no uses
across the entire repository. Remove the dead code. NFC.
llvm-svn: 293445
|
| |
|
|
|
|
|
|
|
| |
This causes unnecessary warnings when building with `cl`. Newer
versions of the C standard permit the redefinition of the macro to the
same value (which is the case here), unfortunately, `cl` does not yet
implement this. Add a check to prevent the redefinition.
llvm-svn: 293439
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Many thread-related libc++ test cases fail on FreeBSD, due to the
following -Werror warnings:
In file included from test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp:17:
In file included from include/thread:97:
In file included from include/__mutex_base:17:
include/__threading_support:222:1: error: mutex '__m' is still held at the end of function [-Werror,-Wthread-safety-analysis]
}
^
include/__threading_support:221:10: note: mutex acquired here
return pthread_mutex_lock(__m);
^
include/__threading_support:231:10: error: releasing mutex '__m' that was not held [-Werror,-Wthread-safety-analysis]
return pthread_mutex_unlock(__m);
^
include/__threading_support:242:1: error: mutex '__m' is still held at the end of function [-Werror,-Wthread-safety-analysis]
}
^
include/__threading_support:241:10: note: mutex acquired here
return pthread_mutex_lock(__m);
^
include/__threading_support:251:10: error: releasing mutex '__m' that was not held [-Werror,-Wthread-safety-analysis]
return pthread_mutex_unlock(__m);
^
include/__threading_support:272:10: error: calling function 'pthread_cond_wait' requires holding mutex '__m' exclusively [-Werror,-Wthread-safety-analysis]
return pthread_cond_wait(__cv, __m);
^
include/__threading_support:278:10: error: calling function 'pthread_cond_timedwait' requires holding mutex '__m' exclusively [-Werror,-Wthread-safety-analysis]
return pthread_cond_timedwait(__cv, __m, __ts);
^
6 errors generated.
This is because on FreeBSD, the pthread functions have lock annotations.
Since the functions in __thread_support are internal to libc++ only, add
no_thread_safety_analysis attributes to suppress these warnings.
Reviewers: mclow.lists, EricWF, delesley, aaron.ballman
Reviewed By: aaron.ballman
Subscribers: ed, aaron.ballman, joerg, emaste, cfe-commits
Differential Revision: https://reviews.llvm.org/D28520
llvm-svn: 293197
|