Commit Graph

4099 Commits

Author SHA1 Message Date
Marshall Clow
426546ecec Stop using random_shuffle in the libc++ test suite. It's going to be removed in c++17. Use shuffle() instead. No change to libc++, just the tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294328 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-07 18:41:25 +00:00
Marshall Clow
542c6e8f9b Mark LWG2784 as ready
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294311 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-07 15:34:20 +00:00
Saleem Abdulrasool
166d27ed31 filesystem: return the constructed object
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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294270 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-07 02:46:59 +00:00
Marshall Clow
24597f254d Add some tests to verify that we implement LWG#2837 correctly. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294194 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-06 16:03:23 +00:00
Marshall Clow
c3eec461e7 Fix a typo - extra '>'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294190 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-06 15:29:03 +00:00
Marshall Clow
5a00ab8ea7 Set up 'upcoming meeting' bug list
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294189 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-06 15:17:22 +00:00
Saleem Abdulrasool
cda122b353 Refer to _LIBCPP_MSVC macro where applicable
Replace preprocess conditions of defined(_MSC_VER) &&
!defined(__clang__) with defined(_LIBCPP_MSVC).  NFC.

Patch by Dave Lee!

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294171 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-06 05:26:49 +00:00
Eric Fiselier
a67aa062c6 Mark LWG 2765 as complete. No changes needed
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294167 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-06 02:41:49 +00:00
Eric Fiselier
07d23d5d93 Implement LWG 2773 - std::ignore should be constexpr.
In addition to the PR for LWG 2773 this patch also ensures
that each of std::ignores constructors or assignment operators
are constexpr.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294165 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-06 01:25:31 +00:00
Stephan T. Lavavej
fdbd18ff71 [libcxx] [test] Strip trailing whitespace.
No functional change, no code review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294161 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 22:48:27 +00:00
Stephan T. Lavavej
19ab479cc2 [libcxx] [test] Fix comment typos.
No functional change, no code review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294160 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 22:48:20 +00:00
Stephan T. Lavavej
b40cb9832b [libcxx] [test] Avoid MSVC's non-Standard ABI in underlying_type.pass.cpp.
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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294159 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 22:48:13 +00:00
Stephan T. Lavavej
041fb56800 [libcxx] [test] Fix Clang -Wpessimizing-move "moving a temporary object prevents copy elision".
N4618 30.6.6 [futures.unique_future]/12 declares "shared_future<R> share() noexcept;".

Fixes D29139.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294158 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 22:48:07 +00:00
Stephan T. Lavavej
02af098ef7 [libcxx] [test] Fix Clang -Wdeprecated-declarations with MSVC's CRT.
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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294157 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 22:48:02 +00:00
Stephan T. Lavavej
0eb6bb8d2d [libcxx] [test] Fix Clang -Wunused-local-typedef, part 3/3.
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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294156 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 22:47:54 +00:00
Stephan T. Lavavej
939607910d [libcxx] [test] Fix Clang -Wunused-local-typedef, part 2/3.
These typedefs were completely unused.

Fixes D29136.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294155 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 22:47:41 +00:00
Stephan T. Lavavej
5597800045 [libcxx] [test] Fix Clang -Wunused-local-typedef, part 1/3.
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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294154 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 22:47:09 +00:00
Marshall Clow
0becc206e3 Restore the _NOEXCEPT on the dtor of bad_optional_access. Destructors are 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294142 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 20:52:32 +00:00
Eric Fiselier
a1c7fbb6f9 Fix variant build errors with GCC 7
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294141 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 20:36:07 +00:00
Eric Fiselier
d78b104afa Adjust Apple ABI list after r294133
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294139 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 20:17:41 +00:00
Eric Fiselier
d55abe9d82 Adjust Linux ABI list after r294133
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294138 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 20:14:18 +00:00
Marshall Clow
e2261bde80 Change the base class of std::bad_optional_access. This is a (subtle) ABI 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294133 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 20:06:38 +00:00
Saleem Abdulrasool
7566869dab filesystem: fix n4100 conformance for temp_directory_path
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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294127 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 17:21:52 +00:00
Eric Fiselier
1138f041fc Remove CMake hack
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294116 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 01:19:02 +00:00
Eric Fiselier
dab86778df Fix typo in docs
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294115 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 01:16:25 +00:00
Eric Fiselier
b89eba01e8 Recommit [libcxx] Never use <cassert> within libc++
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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294107 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-04 23:22:28 +00:00
Eric Fiselier
236b752f2b Fix inconsistency in tuple's SFINAE. Patch from Andrey Khalyavin"
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294106 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-04 22:57:01 +00:00
Eric Fiselier
9e6abfa091 Mark basic_string::assign templates as inline to improve ABI stability.
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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294100 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-04 20:38:35 +00:00
Eric Fiselier
b1b1dcf538 Undefine min/max in __tree
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294099 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-04 20:27:46 +00:00
Dan Albert
e520f0b308 Avoid implementation defined behavior in a test.
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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293926 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-02 19:44:11 +00:00
Asiri Rathnayake
1773efdab3 Extend XFAIL to c++98.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293881 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-02 11:56:26 +00:00
Marshall Clow
90b3732f7a Fix up some no-exception compile failures
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293623 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-31 13:12:32 +00:00
Alex Lorenz
cb14d02f6d Workaround new -Wshadow warning introduced by r293599
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293619 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-31 12:37:48 +00:00
Marshall Clow
9247fd2f79 Fix PR#31779: basic_string::operator= isn't exception safe.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293599 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-31 03:40:52 +00:00
Justin Bogner
e70b4ec8af Revert "Adorn __call_once_proxy with inline and _LIBCPP_INLINE_VISIBILITY"
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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293581 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-31 01:26:09 +00:00
Saleem Abdulrasool
445b823bf1 experimental: avoid using raw _WIN32 in filesystem
Use the _LIBCPP_WIN32API macro instead of _WIN32 checks.  Fix a missed
renaming for style conformance.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293543 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30 19:57:27 +00:00
Saleem Abdulrasool
5c518e17a9 experimental: port directory_iterator to Windows
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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293531 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30 18:50:34 +00:00
Saleem Abdulrasool
1d3b737603 experimental: add missing file header
The directory_iterator implementation file was missing the file header.
Add one.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293530 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30 18:50:32 +00:00
Saleem Abdulrasool
52241cb511 experimental: remove some extraneous _LIBCPP_FUNC_VIS
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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293454 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30 03:58:26 +00:00
Saleem Abdulrasool
eebb4f71e0 experimental: inline single use of a typedef
The typedef is not particularly long, and used in exactly one location.
Just spell it out at the site.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293450 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30 00:15:50 +00:00
Saleem Abdulrasool
b35cd98bc1 experimental: tolerate the existence of a __deref macro
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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293449 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30 00:15:47 +00:00
Saleem Abdulrasool
286816274d experimental: remove dead function
This template was defined inline, within the TU only and had no uses
across the entire repository.  Remove the dead code.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293445 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-29 22:31:28 +00:00
Saleem Abdulrasool
bc116591fd config: prevent the re-definition of a macro
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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293439 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-29 18:16:33 +00:00
Dimitry Andric
362353aa2d Disable thread safety analysis for some functions in __thread_support
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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293197 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-26 18:37:18 +00:00
Marshall Clow
da709135c5 Fixed a couple of invalid statuses for 2665 and 2758
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293179 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-26 14:36:14 +00:00
Asiri Rathnayake
bcc92d75df Fix chromium build (libcxx)
Remove the reference to pthread_mach_thread_np() in libcxx headers.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293167 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-26 10:40:17 +00:00
Marshall Clow
f783971aa0 Use the new __has_feature(cxx_constexpr_string_builtins) for detection of the C-string intrinsics for constexpr support in std::char_traits. Thanks to Richard for the intrisic support.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293154 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-26 06:58:29 +00:00
Marshall Clow
19cd3fd00f Fixed a typo in the synopsis (noecept -> noexcept). Thanks to Kim for the catch
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293079 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-25 20:14:03 +00:00
Mehdi Amini
8a032c59d0 [libcxx] Mentions "targeting C++11 and above" instead of "targeting C++11" in the doc
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293071 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-25 17:00:30 +00:00
Marshall Clow
9bb0cca646 Implement LWG2556: Wide contract for future::share()
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292992 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 23:28:25 +00:00