Commit Graph

3772 Commits

Author SHA1 Message Date
Steven Wu
244033db8b Remove XFAIL in implicit_deduction_guides tests
The clang assertion causing these tests failing with sanitizer is fixed
in r295794. All the bots running libcxx tests should be upgraded and
running the compiler with the fix.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296385 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 21:10:41 +00:00
Asiri Rathnayake
3f017a82a2 Fix LIBCXX_HAS_EXTERNAL_THREAD_API builds. NFC.
Add the missing check in the __config header.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296351 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 16:10:57 +00:00
Asiri Rathnayake
62aeff93e9 Fix typo in error message. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296346 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 15:49:51 +00:00
Asiri Rathnayake
dec9851c7f Fix cmake dependency for the external-thread-library variant. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296338 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 13:19:25 +00:00
Saleem Abdulrasool
e891cc8c09 Revert "threading_support: make __thread_sleep_for be alertable"
This reverts SVN r295329.  Although `__libcpp_thread_sleep_for` should
be alertable, the implementation causes a large regression in the test
suite.  Add a FIXME item there for now to get the test suite in a better
state before attempting to fix that behaviour.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295561 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-18 19:28:43 +00:00
Saleem Abdulrasool
7556597a12 test: silence warnings on clang under clang-cl
When running under clang-cl mode, we do not define `__GNUC__`, resulting
in the test failing.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295560 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-18 19:28:41 +00:00
Saleem Abdulrasool
1eab168286 math: add type promoting template definition on MSVCRT
When building with MSVCRT, we need to manually provide the type
promoting overloads to allow the correct type deduced invocation for
signbit(Int) and fpclassify(int).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295559 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-18 19:28:38 +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
Saleem Abdulrasool
958d196f22 test: prevent incorrect quoting of paths
The path would previously get an extra leading space as the arguments
would be parsed when generating the final command to run.  Pretokenise
the arguments to permit proper quoting of the paths.  This avoids a
number of ignoring non-existent path warnings from clang.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295511 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 23:08:46 +00:00
Saleem Abdulrasool
29a8300460 math: fix typo in macro
MAJOR was misspelt as NAJOR.  Fix the spelling.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295510 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 23:08:44 +00:00
Saleem Abdulrasool
e72cf6de5a cmath: Use c99 math on a new enough msvcrt
MSVCRT 14+ supports the C99 math routines that we need.  Use them
accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295509 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 23:08:42 +00:00
Eric Fiselier
b7fd0be370 Update all bug URL's to point to https://bugs.llvm.org/...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295434 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 08:37:03 +00:00
Eric Fiselier
ba5f008f88 Use inline namespaces with GCC instead of __attribute__((__strong__)).
GCC 7.0.1 started warning that __attribute__((__strong__)) is depricated.
This patch switches to using inline namespace with GCC instead. I believe
this wasn't done originally in order to support older GCC versions w/o
support for inline namespaces, or because earlier versions of GCC warned
users that the STL was using an inline namespace (even though it shouldn't affect users).

However I believe all of the above problems are gone for GCC 4.9 and greater.
Therefore switching to using inline namespaces instead of using __strong__
is the most correct behavior.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295428 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 07:31:38 +00:00
Eric Fiselier
8c9af4d299 Remove dead code in test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295423 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 07:00:04 +00:00
Eric Fiselier
836ae8fa96 add implicit deduction guide tests for string_view
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295422 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 06:59:11 +00:00
Eric Fiselier
224dbbb3d6 Work around Clang assertion when testing C++17 deduction guides with '-g'.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295417 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 05:04:09 +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
Eric Fiselier
f9aeac6b4e Mark a couple for basic_string member templates as inline. no ABI change this time.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295403 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 02:31:56 +00:00
Eric Fiselier
43ec7b868c update revision in CHANGELOG.TXT and fix python error
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295399 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 01:56:57 +00:00
Eric Fiselier
25380e401c Remove more basic_string member function templates from the dylib exports
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295398 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 01:53:16 +00:00
Eric Fiselier
0eaf2e8474 [libc++] Fix PR 31938 - std::basic_string constructors use non-deductible parameter types.
Summary:
This patch fixes http://llvm.org/PR31938. The description below is copy/pasted from the bug:

The standard says:

template<class charT, class traits = char_traits<charT>,
         class Allocator = allocator<charT>>
class basic_string {
  using value_type = typename traits::char_type;
  // ...
  basic_string(const charT* s, const Allocator& a = Allocator());
};

libc++ actually chooses to declare the constructor as

  basic_string(const value_type* s, const Allocator& a = Allocator());

The implicit deduction guides from class template argument deduction make what was previously an implementation detail visible:

std::basic_string s = "foo"; // error, can't deduce charT.

The constructor in question is in the libc++ DSO, but fortunately it looks like fixing this will not result in an ABI break.


@rsmith How does this look? I did more than just the constructors mentioned in the PR, but IDK how far to take it.


Reviewers: mclow.lists, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits, rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295393 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 01:17:10 +00:00
Eric Fiselier
4203bfb5d3 add tests for ENAMETOOLONG
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295390 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 01:00:37 +00:00
Marshall Clow
d5854559eb Update a couple of issue statuses
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295355 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-16 18:50:30 +00:00
Saleem Abdulrasool
af5f91fd19 math: correct the MSVCRT condition
Fixes a number of tests in the testsuite on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295330 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-16 15:47:50 +00:00
Saleem Abdulrasool
e80bd1ab0b threading_support: make __thread_sleep_for be alertable
On Windows, we were using `Sleep` which is not alertable.  This means
that if the thread was used for a user APC or WinProc handling and
thread::sleep was used, we could potentially dead lock.  Use `SleepEx`
with an alertable sleep, resuming until the time has expired if we are
awoken early.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295329 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-16 15:47:45 +00:00
Eric Fiselier
2c477cb41a Add tests for noexcept functions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294995 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13 22:44:39 +00:00
Saleem Abdulrasool
5748d2b404 config: disable thread safety analysis on COFF
clang cannot properly handle __declspec and __attribute__ on classes
right now.  This prevents the shared_mutex tests from working.  Disable
the use of the annotation on COFF targets.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294958 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13 15:26:51 +00:00
Saleem Abdulrasool
766ba68107 math: actually pull the declarations/overloads into std
The previous changes missed the change to include/cmath.  These changes
allow some of the rand.distribution tests to pass on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294957 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13 15:26:50 +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
bacb35f5ae math: follow up to SVN r294902
Pull in the math functions from ucrt 14+ after auditing the library.  It
seems that they are now complete for C99 math.  Fixes more windows
tests!

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294918 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 21:42:37 +00:00
Saleem Abdulrasool
bd18417b4d test: use char32_t rather than wchar_t
wchar_t is not as portable as char32_t.  On Windows, wchar_t is
16-bytes and on Linux 32-bits.  The conversion to utf8 causes the
characters to exceed the limits on char16_t, resulting in tautological
comparisons.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294917 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 21:42:35 +00:00
Saleem Abdulrasool
effe3dc412 test: mark requirement for pthread test
This test explicitly is checking the behaviour of std::thread and
pthread interactions.  This requires pthreads.  Add an appropriate
requirement.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294903 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 17:37:48 +00:00
Saleem Abdulrasool
be3d93ca48 math: pull more C functions from std
The newer ucrt version provides the gamma meth routines.  Includede them
when building the library.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294902 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 17:37:45 +00:00
Saleem Abdulrasool
0849d28af1 test: squelch -Wreturn-type error
Add an unreachable marker to avoid a -Wreturn-type error when building
on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294901 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 17:37:44 +00:00
Saleem Abdulrasool
430800ddb8 cmath: adjust math forwards for Windows
The newer versions of ucrt have the math routines.  Use the CRT version
to determine if we should include the math routines.  Fixes two tests
for Windows.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294899 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 16:44:17 +00:00
Ed Schouten
c253e58209 Remove a now unneeded __CloudABI__ check.
CloudABI has gained the setlocale() function in the meantime, meaning
there is no longer a need to conditionalize this.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294833 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 08:33:16 +00:00
Ed Schouten
ff5eeb6bee Fix the build of thread.cpp on CloudABI.
CloudABI does provide unistd.h, but doesn't define __unix__. We need to
include this header file to make hardware_concurrency work.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294832 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 08:30:18 +00:00
Marshall Clow
197b8821c6 Fix a bug I introduced in the tests for experimental::lcm and experimental::gcd.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294798 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 22:44:14 +00:00
Marshall Clow
ebf66a385f Make lcm/gcd work better in edge cases. Fixes a UBSAN failure.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294779 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 20:49:08 +00:00
Eric Fiselier
00d9a944af Fix yet another Apple buildit bug
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294732 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 09:25:15 +00:00
Eric Fiselier
f2dbd02b30 Attempt to fix Apple buildit bots
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294731 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 09:16:29 +00:00
Eric Fiselier
1edf3166ef Recommit "Split exception.cpp and new.cpp implementation into different files for different runtimes."
This recommits r294707 with additional fixes. The main difference is
libc++ now correctly builds without any ABI library.

exception.cpp is a bloody mess. It's full of confusing #ifdef branches for
each different ABI library we support, and it's getting unmaintainable.

This patch breaks down exception.cpp into multiple different header files,
roughly one per implementation. Additionally it moves the definitions of
exceptions in new.cpp into the correct implementation header.

This patch also removes an unmaintained libc++abi configuration.
This configuration may still be used by Apple internally but there
are no other possible users. If it turns out that Apple still uses
this configuration internally I will re-add it in a later commit.
See http://llvm.org/PR31904.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294730 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 08:57:35 +00:00
Eric Fiselier
d3298ad74e Revert "Split exception.cpp and new.cpp implementation into different files for different runtimes."
The compiler-rt CMake configuration needs some tweaking before this can land.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294727 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 07:43:08 +00:00
Eric Fiselier
e1b6382ee3 Properly escape ShellTest subsitutions on Windows. Try 2
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294721 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 06:59:07 +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
Eric Fiselier
f3078f63a9 properly escape compiler path in .sh.cpp tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294718 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 06:38:02 +00:00
Saleem Abdulrasool
b9eccbec08 test: allow -target usage on Windows
When running the tests on Windows with a debug build, _DEBUG must be
added to the flags prior to the -target as the forced inclusion of a
header will prevent the compile test for the flag to fail.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294716 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 06:24:34 +00:00
Eric Fiselier
801e00b0cd Correctly default to using the system libc++abi on Apple.
This patch fixes a regression where libc++ didn't correctly
select the system libc++abi when no in-tree version was found.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294712 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 05:07:03 +00:00