Commit Graph

4687 Commits

Author SHA1 Message Date
Marshall Clow c6b908d0bb Wrote my own version of is_permutation; that was dominating the timings
llvm-svn: 322920
2018-01-19 03:17:45 +00:00
Marshall Clow 1885052589 Add memory tracking
llvm-svn: 322872
2018-01-18 18:37:11 +00:00
Marshall Clow a9bf43b1fe Use high_resolution_clock instead of steady_clock. Also now builds with gcc 7.2 (for comparison purposes)
llvm-svn: 322864
2018-01-18 17:01:34 +00:00
Marshall Clow 4f0de28c77 A simple program for testing OSS-Fuzz test cases locally.
llvm-svn: 322863
2018-01-18 16:52:19 +00:00
Eric Fiselier 1903976d37 Update Google Benchmark library
llvm-svn: 322812
2018-01-18 04:23:01 +00:00
Eric Fiselier decf22e50f Fix most GCC test failures.
This patch fixes almost all currently failing tests when
using GCC ToT.

The specific changes are:

(A) Workaround gcc.gnu.org/PR83921 which rejects variables w/o initializers
in constexpr contexts -- even when the variable is an empty class. This
bug has been worked around at all callsites by adding an initializer.
Additionally a new test, constexpr_init.pass.cpp, has been added to
test that Clang doesn't suffer from these bugs.

(B) Fix streambuf.assign/swap.pass.cpp. This test was never actually
calling the swap method as intended. In fact, the swap function it
intended to call was ill-formed when instantiated. GCC diagnosed
this ill-formedness w/o needing an instantiation.

(C) size_delete11.pass.cpp was fixed by adding c++2a to the list of
unsupported dialects.

llvm-svn: 322810
2018-01-18 03:41:06 +00:00
Peter Collingbourne 5e27cce467 libcxx: Define set_unexpected, _get_unexpected and __uncaught_exceptions without dllimport.
It turns out that the MSVC headers define these functions without
dllimport even when compiling with /MD. This change fixes the resulting
compile-time error.

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

llvm-svn: 322794
2018-01-18 00:33:35 +00:00
Eric Fiselier 6b3e48b46a Fix nodiscard failure tests on compilers w/o -verify.
Previously .fail.cpp tests for nodiscard were run with -Wunused-result
being a warning, not an error, when the compiler didn't support -verify.

When -verify isn't enabled this change judiciously adds -Werror=unused-result
when to only the failure tests containing the // expected-error string for nodiscard.

As a drive-by change, this patch also adds a missing // UNSUPPORTED: c++2a to
a test which was only supposed to run in C++ <= 11.

llvm-svn: 322776
2018-01-17 22:48:09 +00:00
Peter Collingbourne b89956c812 libcxx: Disable CFI in function std::get_temporary_buffer.
The specification of this function mandates a cast to uninitialized
T*, which is forbidden under CFI.

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

llvm-svn: 322744
2018-01-17 19:32:35 +00:00
Peter Collingbourne 4bdb80faf2 libcxx: Stop using private MSVC macros in the exception implementation.
Inline the provided "fallback" definitions (which seem to always be
taken) that expand to __cdecl into users. The fallback definitions
for the *CRTIMP* macros were wrong in the case where the CRT is being
linked statically, so define our own macro as a replacement.

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

llvm-svn: 322617
2018-01-17 04:37:04 +00:00
Marshall Clow 12f0a77902 More constexpr algorithms from P0202. search/search_n
llvm-svn: 322566
2018-01-16 15:48:27 +00:00
Marshall Clow a58bdf9f69 Change an internal table of constants for the poisson distribution from
type 'result_type' to 'double'. The only thing that we ever do with
these numbers is to promote them to 'double' and use them in a division.
For small result_types, the values were getting truncated, skewing the
results. Thanks to James Nagurne for the suggestion.

llvm-svn: 322556
2018-01-16 14:54:36 +00:00
Marshall Clow d57c03ddca More constexpr algorithms from P0202: lower_bound, upper_bound, equal_range, binary_search
llvm-svn: 322529
2018-01-16 02:34:41 +00:00
Marshall Clow a38c495f22 Actually CALL the constexpr tests.
llvm-svn: 322528
2018-01-16 02:11:13 +00:00
Marshall Clow 6538e28d5d More constexpr (re P0202) - equal and mismatch
llvm-svn: 322527
2018-01-16 02:04:10 +00:00
Marshall Clow da97ec6c10 Fix constexpr failure on C++11-based buildbots.
llvm-svn: 322507
2018-01-15 19:59:09 +00:00
Marshall Clow 056f15e3c5 More constexpr from P0202. count and count_if. Also fix a comment that Morwenn noted.
llvm-svn: 322506
2018-01-15 19:40:34 +00:00
Marshall Clow 404ee020f0 Some of the tests from earlier today had 'int' as the return type when it should have been 'bool'. Fix that. It doesn't change the behavior of any of the tests, but it's more accurate.
llvm-svn: 322505
2018-01-15 19:32:32 +00:00
Marshall Clow 8694428e36 More P0202 constexpr-ifying. All the find_XXX algorithms in this commit.
llvm-svn: 322504
2018-01-15 19:26:05 +00:00
Marshall Clow 674f9128b7 partition_point gets the P0202 treatment
llvm-svn: 322493
2018-01-15 17:53:34 +00:00
Marshall Clow 706ffef713 More constexpr algorithms from P0202. any_of/all_of/none_of.
llvm-svn: 322492
2018-01-15 17:20:36 +00:00
Marshall Clow 49c7643c39 First part of P0202: Adding constexpr modifiers to functions in <algorithm> and <utility>. This commit is all the is_XXX algorithms.
llvm-svn: 322489
2018-01-15 16:16:32 +00:00
Ekaterina Vaartis b848122b5e Add error code handling to remove_all test
As mentioned by EricWF in revision D41830

llvm-svn: 322351
2018-01-12 05:02:06 +00:00
Volodymyr Sapsai a051024cac [libcxx] Make std::basic_istream::get 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]p9:
  [...] In any case, if n is greater than zero it then stores a null
  character into the next successive location of the array.

rdar://problem/35566567

Reviewers: EricWF, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 322326
2018-01-11 23:23:49 +00:00
Marshall Clow 0e22bf8cb9 Implement an _is_allocator type trait for use in deduction guides.
llvm-svn: 322306
2018-01-11 19:36:22 +00:00
Marshall Clow 31163f629b Fix some too-big local arrays. Thanks to dcdillon for the patch. Reviewed as D28217
llvm-svn: 322295
2018-01-11 17:16:52 +00:00
Ekaterina Vaartis e44cbaf704 Make std::experimental::filesystem::remove and remove_all return false or 0 if the file doesn't exist
Differential Revision: https://reviews.llvm.org/D41830

llvm-svn: 322293
2018-01-11 17:04:29 +00:00
Peter Collingbourne 4566d827a1 libcxx: Stop providing a definition of __GLIBC_PREREQ.
An application may determine whether the C standard library is glibc
by testing whether __GLIBC_PREREQ is defined. This breaks if libc++
provides its own definition. Instead, define our own macro in our
namespace with the desired semantics.

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

llvm-svn: 322201
2018-01-10 18:16:58 +00:00
Marshall Clow 6b40646bec Fix misspelled macro name - thanks to andrew@ispras.ru for the catch
llvm-svn: 322196
2018-01-10 16:25:04 +00:00
Stephan T. Lavavej 04576cc060 [libcxx] [test] Improve MSVC portability.
test/support/msvc_stdlib_force_include.hpp
When testing MSVC's STL with C1XX, simulate a couple more compiler feature-test macros.

When testing MSVC's STL, simulate a few library feature-test macros.

test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
The vector_size attribute is a non-Standard extension that's supported by Clang and GCC,
but not C1XX. Therefore, guard this with `__has_attribute(vector_size)`.

Additionally, while these tests pass when MSVC's STL is compiled with Clang,
I don't consider this to be a supported scenario for our library,
so also guard this with defined(_LIBCPP_VERSION).

test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
N4713 23.14.10 [func.not_fn]/1 depicts only `call_wrapper(call_wrapper&&) = default;`
and `call_wrapper(const call_wrapper&) = default;`. According to
15.8.2 [class.copy.assign]/2 and /4, this makes call_wrapper non-assignable.
Therefore, guard the assignability tests as libc++ specific.

Add a (void) cast to tolerate not_fn() being marked as nodiscard.

Fixes D41213.

llvm-svn: 322144
2018-01-10 00:39:46 +00:00
Petr Hosek 0f03c79b6d [libcxx] Support the use of compiler-rt in lit tests
Don't link tests against libgcc when compiler-rt is being used.

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

llvm-svn: 322044
2018-01-08 23:36:53 +00:00
Dan Albert 553b09b515 Revert "Make rehash(0) work with ubsan's unsigned-integer-overflow."
Seems to have broken some tests since I first wrote this a while
back. Will reland after checking what went wrong with the tests.

This reverts commit 7023194c8d11a081fd01ed25308b3d60193c6a06.

llvm-svn: 322039
2018-01-08 22:57:12 +00:00
Marshall Clow e426a832dd Apparently 'C++14' is different than 'c++14'
llvm-svn: 322034
2018-01-08 22:16:30 +00:00
Dan Albert 0802327a39 Make rehash(0) work with ubsan's unsigned-integer-overflow.
Reviewers: mclow.lists, EricWF

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 322031
2018-01-08 21:49:12 +00:00
Billy Robert O'Neal III b6e3c55465 Change add_ten to add_one to avoid triggering ubsan integer overflow.
llvm-svn: 322021
2018-01-08 19:45:16 +00:00
Marshall Clow d835e59211 Add the C++17 extensions to std::search. Include the default searcher, but not the Boyer-Moore or Boyer-Moore-Horspool searcher (yet). BUT put the BM and BMH tests in place, marked to XFAIL. The other searchers will follow soon
llvm-svn: 322019
2018-01-08 19:18:00 +00:00
Marshall Clow 86de37aee6 Document upcoming TS feature removal
llvm-svn: 322011
2018-01-08 17:43:46 +00:00
Marshall Clow 464de6ca09 Mark the transparent version set::count() as const. Thanks to Ivan Matek for the bug report.
llvm-svn: 321966
2018-01-07 17:39:57 +00:00
Dimitry Andric 672f7adce5 Add pre-C++11 is_constructible wrappers for 3 arguments
Summary:
After rL319736 for D28253 (which fixes PR28929), gcc cannot compile `<memory>` anymore in pre-C+11 modes, complaining:

```
In file included from /usr/include/c++/v1/memory:648:0,
                 from test.cpp:1:
/usr/include/c++/v1/memory: In static member function 'static std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::make_shared(_A0&, _A1&, _A2&)':
/usr/include/c++/v1/memory:4365:5: error: wrong number of template arguments (4, should be at least 1)
     static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" );
     ^
In file included from /usr/include/c++/v1/memory:649:0,
                 from test.cpp:1:
/usr/include/c++/v1/type_traits:3198:29: note: provided for 'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible'
 struct _LIBCPP_TEMPLATE_VIS is_constructible
                             ^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/v1/memory:648:0,
                 from test.cpp:1:
/usr/include/c++/v1/memory:4365:5: error: template argument 1 is invalid
     static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" );
     ^
/usr/include/c++/v1/memory: In static member function 'static std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::allocate_shared(const _Alloc&, _A0&, _A1&, _A2&)':
/usr/include/c++/v1/memory:4444:5: error: wrong number of template arguments (4, should be at least 1)
     static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" );
     ^
In file included from /usr/include/c++/v1/memory:649:0,
                 from test.cpp:1:
/usr/include/c++/v1/type_traits:3198:29: note: provided for 'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible'
 struct _LIBCPP_TEMPLATE_VIS is_constructible
                             ^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/v1/memory:648:0,
                 from test.cpp:1:
/usr/include/c++/v1/memory:4444:5: error: template argument 1 is invalid
     static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" );
     ^
```

This is also reported in https://bugs.freebsd.org/224946 (FreeBSD is apparently one of the very few projects that regularly builds programs against libc++ with gcc).

The reason is that the static assertions are invoking `is_constructible` with three arguments, while gcc does not have the built-in `is_constructible` feature, and the pre-C++11 `is_constructible` wrappers in `<type_traits>` only provide up to two arguments.

I have added additional wrappers for three arguments, modified the `is_constructible` entry point to take three arguments instead, and added a simple test to is_constructible.pass.cpp.

Reviewers: EricWF, mclow.lists

Reviewed By: EricWF

Subscribers: krytarowski, cfe-commits, emaste

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

llvm-svn: 321963
2018-01-07 16:45:11 +00:00
Saleem Abdulrasool ae20590c17 Correct mistake in pragma usage for Windows
The autolink pragma was missing the pragma name itself.  This would
result in the pragma being silently dropped.

llvm-svn: 321937
2018-01-06 18:47:03 +00:00
Billy Robert O'Neal III 231d15e086 Add casts to prevent narrowing warnings.
llvm-svn: 321923
2018-01-06 02:50:03 +00:00
Billy Robert O'Neal III 1e1195dce5 [libcxx] [test] Remove nonstandard things and resolve warnings in Xxx_scan tests
Reviewed as https://reviews.llvm.org/D41748

* These tests use function objects from functional, back_inserter from iterator, and equal from algorithm, so add those headers.
* The use of iota targeting vector<unsigned char> with an int parameter triggers warnings on MSVC++ assigning an into a unsigned char&; so change the parameter to unsigned char with a static_cast.
* Avoid naming unary_function in identity here as that is removed in '17. (This also fixes naming _VSTD, _NOEXCEPT_, and other libcxx-isms)
* Change the predicate in the transform tests to add_ten so that problems with multiple application are caught.

llvm-svn: 321922
2018-01-06 02:18:20 +00:00
Martin Storsjo bf02a09103 [cmake] Add a config option LIBCXX_HAS_WIN32_THREAD_API for enforcing win32 threads
This allows keeping libcxx using win32 threads even if a
version of pthread.h is installed.

This matches the existing cmake option LIBCXX_HAS_PTHREAD_API.

Also add missing documentation about the internal define
_LIBCPP_HAS_THREAD_API_WIN32.

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

llvm-svn: 321896
2018-01-05 20:48:29 +00:00
Billy Robert O'Neal III 3770e403ee Move + and * operators of MoveOnly into MoveOnly.h.
llvm-svn: 321852
2018-01-05 01:32:00 +00:00
Billy Robert O'Neal III 4958692ad9 Fix incorrect handling of move-only types in transform_reduce iter iter iter init, and add test.
llvm-svn: 321851
2018-01-05 01:31:57 +00:00
Billy Robert O'Neal III ca444e13dc Automated trailing whitespace removal by VS Code.
llvm-svn: 321850
2018-01-05 01:31:55 +00:00
Billy Robert O'Neal III d432d89454 Add move-only types test to transform_reduce iter iter iter init op op.
llvm-svn: 321849
2018-01-05 01:31:52 +00:00
Billy Robert O'Neal III 1ef4ef2236 Add move-only types test for transform_reduce bop/uop.
llvm-svn: 321848
2018-01-05 01:31:50 +00:00
Billy Robert O'Neal III 61d97da4f4 Fix nonstandard bits in transform_reduce_iter_iter_init_bop_uop.
* _VSTD should be std.
* <utility> is needed for forward.
* unary_function is no longer standard (and unnecessary for this, a C++17-only test)

llvm-svn: 321847
2018-01-05 01:31:47 +00:00
Hans Wennborg 6be97eca93 Update version to 7.0.0svn: cmake, include files and docs
llvm-svn: 321725
2018-01-03 15:40:29 +00:00
Marshall Clow 12e17b19ba Mark LWG2824 as complete. We already did it, but I added a test to be sure
llvm-svn: 321689
2018-01-03 04:37:30 +00:00
Marshall Clow bae5d279ed Mark issue #2866 as "nothing to do"
llvm-svn: 321687
2018-01-03 03:43:32 +00:00
Marshall Clow dd74d83f84 Implement p0258r2: has_unique_object_representations
llvm-svn: 321685
2018-01-03 02:32:28 +00:00
Marshall Clow 2b377c99f7 One more (should be) inline variable that is defined in the dylib
llvm-svn: 321666
2018-01-02 19:23:30 +00:00
Marshall Clow a911f39d3d Un-inline a few more variables that are exported from the dylib.
llvm-svn: 321664
2018-01-02 19:01:45 +00:00
Marshall Clow c8531ebef9 Temporarily revert the inlining of 'piecewise_construct' because it is exported from the dylib.
llvm-svn: 321663
2018-01-02 18:57:47 +00:00
Marshall Clow 28f1dfcbfe A couple more inlined variables that I missed the first time
llvm-svn: 321661
2018-01-02 18:41:01 +00:00
Marshall Clow 40a01d5314 Implement most of P0607: Inline Variables for the Standard Library. This involved marking a lot of variables as inline (but only for C++17 and later).
llvm-svn: 321658
2018-01-02 17:17:01 +00:00
Jonathan Roelofs 0f448409d8 Try again, this time with the correct address
llvm-svn: 321570
2017-12-29 19:26:53 +00:00
Jonathan Roelofs e7bc2eea75 Update CREDITS.txt with personal email
llvm-svn: 321563
2017-12-29 19:15:20 +00:00
Don Hinton 1ec1a9558a [libcxx] Suppress unused warning on apple.
Summary:
This warning is already suppressed on non-apple platforms, so
this change just suppresses it on apple as well.

Reviewers: EricWF, lichray

Reviewed By: lichray

Subscribers: cfe-commits

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

llvm-svn: 321435
2017-12-25 05:33:42 +00:00
Marshall Clow 7d661bb248 Fix the definitions of 'reference' and 'pointer' in string_view that no one uses :-). Thanks to K-ballo for the catch.
llvm-svn: 321188
2017-12-20 16:31:40 +00:00
Peter Collingbourne 22c651c577 libcxx: Fix for basic_stringbuf::seekoff() after r320604.
As a result of this change, the basic_stringbuf constructor that
takes a mode ends up leaving __hm_ set to 0, causing the comparison
"__hm_ - __str_.data() < __noff" in seekoff() to succeed, which caused
the function to incorrectly return -1. The fix is to account for the
possibility of __hm_ being 0 when computing the distance from __hm_
to the start of the string.

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

llvm-svn: 321124
2017-12-19 23:33:16 +00:00
Sam Clegg 5029d676f8 [libcxx] Add WebAssembly support
It turns out that this is the only change required in libcxx
for it to compile with the new `wasm32-unknown-unknown-wasm`
target recently added to Clang.

Patch by Nicholas Wilson!

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

llvm-svn: 320925
2017-12-16 18:59:50 +00:00
Zhihao Yuan 378ae52b10 [libcxx] Fix basic_stringbuf constructor
Summary:
[libcxx] Fix basic_stringbuf constructor

The C++ Standard [stringbuf.cons]p1 defines the effects of the basic_stringbuf
constructor that takes ios_base::openmode as follows:
  Effects: Constructs an object of class basic_stringbuf, initializing the
  base class with basic_streambuf(), and initializing mode with which.
  Postconditions: str() == "".

The default constructor of basic_streambuf shall initialize all its
pointer member objects to null pointers [streambuf.cons]p1.

Currently libc++ calls "str(string_type());" in the aforementioned constructor
setting basic_streambuf's pointers to a non-null value.

This patch removes the call (note that the postcondition str() == ""
remains valid because __str_ is default-initialized) and adds a test checking
that the basic_streambuf's pointers are null after construction.

Thanks Mikhail Maltsev for the patch.

Reviewers: EricWF, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 320604
2017-12-13 18:12:55 +00:00
Stephan T. Lavavej 4d8a75a1ca [libcxx] [test] Fix line endings, avoid unnecessary non-ASCII.
benchmarks/util_smartptr.bench.cpp
Change CRLF to LF.

test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
Consistently comment "\u20ac" as EURO SIGN, its Unicode name, instead of the actual Unicode character.

test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
Avoid non-ASCII dash.

Fixes D40991.

llvm-svn: 320536
2017-12-13 00:51:31 +00:00
Stephan T. Lavavej 79e0733c20 [libcxx] [test] Fix MSVC warnings, null pointer deref.
test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
Silence MSVC warning C4244. This is expected when passing
floating-point values for size.

test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp
test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp
Avoid MSVC "warning C4293: '<<': shift count negative or too big,
undefined behavior". MSVC sees (1ULL << N) and warns - being guarded
by const bool canFit is insufficient. A small change to the code
avoids the warning without the need for a pragma.

Remove a spurious printf() declaration from to_ullong.pass.cpp.

Change ULL to UL in to_ulong.pass.cpp. The ULL suffix was
probably copy-pasted.

test/std/utilities/tuple/tuple.general/ignore.pass.cpp
Use LIBCPP_STATIC_ASSERT for consistency with other files.

test/support/container_test_types.h
Fix a null pointer dereference, found by MSVC /analyze
warning C6011 "Dereferencing NULL pointer 'm_expected_args'."

Fixes D41030.

llvm-svn: 320535
2017-12-13 00:51:27 +00:00
Zhihao Yuan bcde6e715e [libcxx] P0604, invoke_result and is_invocable
Summary:
Introduce a new form of `result_of` without function type encoding.

Rename and split `is_callable/is_nothrow_callable` into `is_invocable/is_nothrow_invocable/is_invocable_r/is_nothrow_invocable_r` (and associated types accordingly)

Change function type encoding of previous `is_callable/is_nothrow_callable` traits to conventional template type parameter lists.


Reviewers: EricWF, mclow.lists, bebuch

Reviewed By: EricWF, bebuch

Subscribers: lichray, bebuch, cfe-commits

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

llvm-svn: 320509
2017-12-12 18:42:04 +00:00
Casey Carter 00c872f353 workaround PR 28385 in __find_exactly_one_checked
Fixes #35578.

Differential Revision: D41048

llvm-svn: 320500
2017-12-12 17:22:24 +00:00
Roger Ferrer Ibanez 6f56d3eee8 [libcxx] Define istream_iterator equality comparison operators out-of-line
Currently libc++ defines operator== and operator!= as friend functions in the
definition of the istream_iterator class template. Such definition has a subtle
difference from an out-of-line definition required by the C++ Standard: these
functions can only be found by argument-dependent lookup, but not by qualified
lookup.

This patch changes the definition, so that it conforms to the C++ Standard and
adds a check involving qualified lookup to the test suite.

Patch contributed by Mikhail Maltsev.

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

llvm-svn: 320363
2017-12-11 13:54:58 +00:00
Shoaib Meenai 927604def6 [libc++] Unbreak Apple buildbots
These buildbots are using the deprecated target name install-libcxx-headers
instead of the more up to date install-cxx-headers, so I need to add an
install-libcxx-headers-stripped target to satisfy them.

llvm-svn: 320201
2017-12-08 21:50:32 +00:00
Stephan T. Lavavej 4626c9a647 [libcxx] [test] Strip trailing whitespace. NFC.
llvm-svn: 319994
2017-12-07 00:50:23 +00:00
Shoaib Meenai f7c7944387 [libc++] Create install-stripped targets
LLVM is gaining install-*-stripped targets to perform stripped installs,
and in order for this to be useful for install-distribution, all
potential distribution components should have stripped installation
targets. LLVM has a function to create these install targets, but since
we can't use LLVM CMake functions in libc++, let's do it manually.

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

llvm-svn: 319959
2017-12-06 21:03:42 +00:00
Saleem Abdulrasool 74f41817a5 Enable auto-linking on Windows
The MSVC driver and clang do not link against the C++ runtime
explicitly.  Instead, they rely on the auto-linking via the pragma
(through `use_ansi.h`) to link against the correct version of the C++
runtime.  Attempt to do something similar here so that linking real C++
code on Windows does not require the user to explicitly specify
`c++.lib` when using libc++ as a C++ runtime on windows.

llvm-svn: 319816
2017-12-05 19:32:49 +00:00
Shoaib Meenai 9a0a00459e [libcxx] Fix intrinsics for MSVC
The parameter was previously renamed but MSVC path was not updated.

Patch by Andrey Khalyavin.

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

llvm-svn: 319802
2017-12-05 17:46:23 +00:00
Marshall Clow fa40ee7779 Mark a couple of internal routines as 'noexcept'
llvm-svn: 319779
2017-12-05 15:56:26 +00:00
Marshall Clow 7700912976 Land D28253 which fixes PR28929 (which we mistakenly marked as fixed before)
llvm-svn: 319736
2017-12-05 04:09:49 +00:00
Marshall Clow c78e12eaf8 Add issue 2587, which was missed
llvm-svn: 319734
2017-12-05 03:51:16 +00:00
Marshall Clow 98360946bb Commit tests for changes in revision 319710
llvm-svn: 319711
2017-12-04 23:04:53 +00:00
Marshall Clow 5dd9220974 Implement more of P0600: '[[nodiscard]] in the library' for C++2a
llvm-svn: 319710
2017-12-04 23:03:42 +00:00
Marshall Clow 936a2fd4b4 Ooops. I checked in a test for a bug I haven't fixed yet. Temporrarily commented it out.
llvm-svn: 319693
2017-12-04 20:46:38 +00:00
Marshall Clow 800259c98d Implement P0457R2: 'String Prefix and Suffix Checking' for c++2a
llvm-svn: 319687
2017-12-04 20:11:38 +00:00
Marshall Clow feb8343281 Fix PR#35948: generate_n does not accept floating point Size arguments.
llvm-svn: 319675
2017-12-04 18:59:14 +00:00
Ben Hamilton e00cd0c408 [libcxx] Set up .arcconfig to point to new Diffusion CXX repository
Summary:
We want to automatically copy the appropriate mailing list
for review requests to the libc++ repository.

For context, see the proposal and discussion here:

http://lists.llvm.org/pipermail/cfe-dev/2017-November/056032.html

Similar to D40179, I set up a new Diffusion repository with callsign
"CXX" for libc++:

https://reviews.llvm.org/source/libcxx/

This explicitly updates libcxx's .arcconfig to point to the new
CXX repository in Diffusion, which will let us use Herald rule H268.

Reviewers: halyavin, EricWF, mclow.lists, compnerd, mstorsjo

Reviewed By: compnerd

Subscribers: cfe-commits, bkramer, dlj, sammccall, klimek, smeenai, mstorsjo, krytarowski

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

llvm-svn: 319666
2017-12-04 17:55:28 +00:00
Hamza Sood 0bf99c6954 Corrected a typo in the building libc++ docs
llvm-svn: 319631
2017-12-03 10:18:35 +00:00
Petr Hosek 5c70428176 [libcxx] Support getentropy as a source of randomness for std::random_device
Use this source use on Fuchsia where this is the oficially way
to obtain randomness. This could be also used on other platforms
that already support getentropy such as *BSD or Linux.

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

llvm-svn: 319523
2017-12-01 06:34:33 +00:00
Petr Hosek 363c631edd Include AddLLVM needed for tests in the right context
AddLLVM is needed for several functions that are used in tests and
as such needs to be included from the right context which previously
wasn't the case.

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

llvm-svn: 319515
2017-12-01 03:16:50 +00:00
Marshall Clow ea44ee202f Fix problems with r'890 when building on machines where sizeof(size_t) != sizeof(unsigned long long) and C++03
llvm-svn: 319106
2017-11-27 22:27:22 +00:00
Marshall Clow a2f3c63282 Revert commit removing allocator support from packaged_task. Will investigate further
llvm-svn: 319091
2017-11-27 20:47:54 +00:00
Marshall Clow d42db7e083 Implement LWG#2921 and LWG#2976 - removing allocator support from packaged_task.
llvm-svn: 319080
2017-11-27 19:43:28 +00:00
Marshall Clow 14d7aac15d Fix PR#35438 - bitset constructor does not zero unused bits
llvm-svn: 319074
2017-11-27 19:03:30 +00:00
Marshall Clow 1ea2f5e374 Fix failure on C++03 bots
llvm-svn: 319042
2017-11-27 16:17:19 +00:00
Marshall Clow 48f3653999 Implement LWG#2948: unique_ptr does not define operator<< for stream output
llvm-svn: 319038
2017-11-27 15:51:36 +00:00
Marshall Clow 3fddff51ba More of P0600; marking allocation routines as [[nodiscard]]
llvm-svn: 318992
2017-11-26 02:55:38 +00:00
Marshall Clow c4eb50563b Fix copy/paste bug in test where we were putting a '3' into a vector<bool>. NFC.
llvm-svn: 318990
2017-11-26 00:39:59 +00:00
Eric Fiselier b7828a8118 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.

llvm-svn: 318989
2017-11-25 23:39:17 +00:00
Marshall Clow 2365c7814a Update C++2a status and add Glen to CREDITS.TXT. Reviewed as https://reviews.llvm.org/D40379
llvm-svn: 318919
2017-11-23 14:50:56 +00:00
Martin Storsjo 771edc7949 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

llvm-svn: 318902
2017-11-23 10:38:18 +00:00
Marshall Clow 69b903eecb Add additional 'UNSUPPORTED' to the test case.
llvm-svn: 318897
2017-11-23 05:43:25 +00:00
Marshall Clow b6ad844e13 Add [[nodiscard]] to std::async as part of P0600.
llvm-svn: 318889
2017-11-23 01:25:03 +00:00
Eric Fiselier 3295274725 [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

llvm-svn: 318865
2017-11-22 19:49:21 +00:00
Marshall Clow 9180eb1f4a Implement p0137r1 - std::launder. Reviewed as https://reviews.llvm.org/D40144
llvm-svn: 318864
2017-11-22 19:49:03 +00:00
Volodymyr Sapsai 374cff69e0 [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.

llvm-svn: 318863
2017-11-22 19:36:54 +00:00
Volodymyr Sapsai 2eb7f433a8 [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.

llvm-svn: 318862
2017-11-22 18:52:36 +00:00
Billy Robert O'Neal III 63db89ff69 Add another test_macros.h include I missed to tuple.by.type.pass.cpp
llvm-svn: 318830
2017-11-22 12:29:17 +00:00
Marshall Clow 4999a5fdd7 Add some tests for operations on const associative containers. Part of LWG#2542
llvm-svn: 318818
2017-11-22 06:02:27 +00:00
Billy Robert O'Neal III 4aef6a08aa Replace assert(true) in tests with actual asserts. Reviewed as https://reviews.llvm.org/D40324
In a17cd7c641c34b6c4bd4845a4d4fb590cb6c238c 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.

llvm-svn: 318812
2017-11-21 23:03:02 +00:00
Martin Storsjo 837c5b6b13 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

llvm-svn: 318810
2017-11-21 22:41:15 +00:00
Billy Robert O'Neal III 020294811f Add missing test_macros.h inclusion.
llvm-svn: 318808
2017-11-21 22:16:57 +00:00
Billy Robert O'Neal III ba40b0566f Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065
llvm-svn: 318804
2017-11-21 21:37:26 +00:00
Eric Fiselier 506a09ba0f 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.

llvm-svn: 318690
2017-11-20 20:23:27 +00:00
Eric Fiselier 577fa7f00f Attempt to fix template depth test failures on older Clang versions
llvm-svn: 318625
2017-11-19 09:46:34 +00:00
Eric Fiselier afa6f83437 Fix min/max usage in variant
llvm-svn: 318622
2017-11-19 04:57:22 +00:00
Eric Fiselier 0ed525382f [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

llvm-svn: 318621
2017-11-19 04:19:44 +00:00
Eric Fiselier 518f24b5b9 Fix nodiscard test when modules are enabled
llvm-svn: 318618
2017-11-19 03:50:35 +00:00
Marshall Clow d1dcda1969 Mark free functions size/empty/data conditionally noexcept.
llvm-svn: 318432
2017-11-16 17:55:41 +00:00
Marshall Clow 2f13e79083 More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in filesystem::path
llvm-svn: 318378
2017-11-16 05:48:32 +00:00
Marshall Clow 80ebbb17a1 More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in match_results. <regex>
llvm-svn: 318375
2017-11-16 04:48:34 +00:00
Marshall Clow 25a7ba4524 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.
llvm-svn: 318328
2017-11-15 20:02:27 +00:00
Casey Carter dc2596e971 [test] Alignment must be > __STDCPP_DEFAULT_NEW_ALIGNMENT__ to call aligned new
Differential Revision: D39221

llvm-svn: 318325
2017-11-15 19:14:45 +00:00
Marshall Clow 5f8d84ec92 Clean up the tests for free data(), size() and empty()
llvm-svn: 318313
2017-11-15 17:47:09 +00:00
Billy Robert O'Neal III 1c240a89ff Tolerate even more [[nodiscard]] in the STL. Reviewed as https://reviews.llvm.org/D39080
llvm-svn: 318277
2017-11-15 07:45:07 +00:00
Billy Robert O'Neal III 83252766f9 Tolerate [[nodiscard]] annotations in the STL. Reviewed as https://reviews.llvm.org/D39033
llvm-svn: 318276
2017-11-15 07:40:37 +00:00
Marshall Clow 72c8fad427 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
llvm-svn: 318269
2017-11-15 05:51:26 +00:00
Marshall Clow 260ad71dfe Still more missing tests - this time for the unordered containers
llvm-svn: 318268
2017-11-15 05:25:36 +00:00
Marshall Clow 8b32246d77 Named the macro wrong in the test.
llvm-svn: 318259
2017-11-15 03:08:39 +00:00
Marshall Clow fc6cc70018 More missing tests - array<>::size() and array<>::max_size()
llvm-svn: 318256
2017-11-15 02:31:14 +00:00
Eric Fiselier 6be7e289b2 Update Appveyor LLVM install link to be current and non-broken
llvm-svn: 318247
2017-11-15 01:37:11 +00:00
Marshall Clow 4cb7d78130 Added tests for xxx.size() and xxx.empty() for all the sequence containers
llvm-svn: 318244
2017-11-15 01:33:33 +00:00
Marshall Clow 1644c12ef8 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
llvm-svn: 318208
2017-11-14 22:26:50 +00:00
Alexander Richardson 42bfedd935 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

llvm-svn: 318144
2017-11-14 11:14:25 +00:00
Marshall Clow 0a5ebdbf6f Another test for LWG2952
llvm-svn: 318126
2017-11-14 01:18:36 +00:00
Marshall Clow 12de6e9c11 Implement LWG2950: std::byte operations are misspecified
llvm-svn: 318125
2017-11-14 01:14:53 +00:00
Marshall Clow ffcfd923d7 Implement LWG2952: iterator_traits should work for pointers to cv T
llvm-svn: 318119
2017-11-14 00:03:10 +00:00
Marshall Clow 843ec14af4 Put the status in the wrong column
llvm-svn: 318012
2017-11-13 04:15:39 +00:00
Marshall Clow fbb0a5aa3f Implement P0550R2: Transformation Trait remove_cvref
llvm-svn: 318011
2017-11-13 03:59:22 +00:00
Marshall Clow 199216376a Two more papers from Albuquerque
llvm-svn: 318000
2017-11-12 18:52:16 +00:00
Marshall Clow 952d249987 Updated C++2a status page with new features/defects approved in Albuquerque.
llvm-svn: 317996
2017-11-12 18:48:42 +00:00
Alex Lorenz 9dae972c66 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

llvm-svn: 317816
2017-11-09 17:54:49 +00:00
Volodymyr Sapsai bc7f6318ee [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

llvm-svn: 317734
2017-11-08 22:30:29 +00:00
Marshall Clow bc97e1cde9 Added include for <cassert>
llvm-svn: 317722
2017-11-08 20:25:47 +00:00
Eric Fiselier 537309342d 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.

llvm-svn: 317611
2017-11-07 20:26:23 +00:00
Eric Fiselier 515e9dbfef 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.

llvm-svn: 317610
2017-11-07 20:20:58 +00:00
Marshall Clow 2e946aa299 Change a bunch of comments from C++1z to C++17. NFC
llvm-svn: 317212
2017-11-02 15:03:25 +00:00
Roger Ferrer Ibanez 5347ebef23 Mark tests as unsupported in C++98 as well
Differential Revision: https://reviews.llvm.org/D38362

llvm-svn: 317210
2017-11-02 15:01:43 +00:00
Marshall Clow c83386cad8 Mark Endian as 'in progress'
llvm-svn: 317209
2017-11-02 14:53:08 +00:00
Dan Albert f33558b224 Revert "[libc++] Don't alias quick_exit if __ANDROID_API__ < 21"
Broke the Darwin build bots.

This reverts commit f56f1bba1ade4a408d403ff050d50e837bae47df.

llvm-svn: 317142
2017-11-01 23:43:07 +00:00
Dan Albert 5a4e27dfa6 [libc++] Don't alias quick_exit if __ANDROID_API__ < 21
Summary:
quick_exit() and at_quick_exit() were introduced in android NDK 21:
https://android.googlesource.com/platform/prebuilts/ndk/+/dev/platform/sysroot/usr/include/stdlib.h#55

This CL conditions `_LIBCPP_HAS_QUICK_EXIT` on `__ANDROID_API__ >= 21`.  The only place this macro is used is in some using declarations: `using ::quick_exit`, `using ::at_quick_exit`.

Also, add a missing include to sys/cdefs.h which is what defines `__BIONIC__`.

Reviewers: thakis, danalbert, EricWF

Reviewed By: danalbert

Subscribers: srhines, krytarowski

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

llvm-svn: 317124
2017-11-01 21:17:56 +00:00
Marshall Clow 3293ddb7ad More statuses, a new patch, too
llvm-svn: 317074
2017-11-01 04:03:35 +00:00
Marshall Clow 13e6e61bae Update the synopsis to match the P/R of 2945. No code changes.
llvm-svn: 317063
2017-11-01 01:27:25 +00:00
Marshall Clow 336c30e299 Fix broken links; update more issues.
llvm-svn: 316970
2017-10-31 00:19:47 +00:00
Marshall Clow 30631ea6aa Add a fail test for aligned_union of an incomplete type. See LWG#2979. NFC
llvm-svn: 316969
2017-10-31 00:05:17 +00:00
Marshall Clow 25d20ba2dd Add more fuzzing bits: partial_sort_copy, partition_copy, unique, unique_copy. No functional change to libc++; this is all test infastructure
llvm-svn: 316951
2017-10-30 19:51:58 +00:00
Eric Fiselier ddfdb32b30 Implement LWG 3013 - some filesystem members should not be noexcept.
LWG 3013 points out that the constructors and increment members
of the directory iterators need to allocate, and therefore cannot
be marked noexcept.

It also points out that `is_empty` and `copy` likely need to allocate
as well, and as such can also not be noexcept.

This patch speculatively implements the resolution removing noexcept,
because libc++ does indeed have the possibility of throwing on allocation
failure.

llvm-svn: 316941
2017-10-30 18:59:59 +00:00
Eric Fiselier 98cdfe6bcd Fix PR35078 - recursive directory iterator's increment method throws incorrectly.
The guts of the increment method for recursive_directory_iterator
was failing to pass an error code object to calls to status/symlink_status,
which can throw under certain conditions.

This patch fixes the issues by correctly propagating the error codes.
However the noexcept still needs to be removed from the signature, as
mentioned in LWG 3014, but that change will be made in a separate commit.

llvm-svn: 316939
2017-10-30 18:43:21 +00:00
Marshall Clow d842505b9b Mark test as unsupported on C++98/03, since it uses move_iterator
llvm-svn: 316917
2017-10-30 16:07:59 +00:00
Marshall Clow 05da5b0205 Fix PR#35119 : set_union misbehaves with move_iterators. Thanks to Denis Yaroshevskiy for both the bug report and the fix.
llvm-svn: 316914
2017-10-30 15:50:00 +00:00
Marshall Clow ccbb496b56 Initial triage
llvm-svn: 316874
2017-10-29 21:57:58 +00:00
Marshall Clow 4a9ee9caaa Update status of 2950
llvm-svn: 316873
2017-10-29 21:43:30 +00:00
Marshall Clow 4e18fe9ac8 Issues to be voted on in ABQ
llvm-svn: 316867
2017-10-29 19:02:00 +00:00
Marshall Clow ac2b3e3a7a Mark string_view's constructor from (ptr,len) as noexcept (an extension). Update the tests to check this (and other noexcept bits
llvm-svn: 316456
2017-10-24 16:30:06 +00:00
Marshall Clow 59b48302a3 Mark string_view literals as 'noexcept'. Fixes PR#25054. Thanks to Pavel K for the bug report.
llvm-svn: 316439
2017-10-24 14:06:00 +00:00
Marshall Clow 5c947f0dd4 More fuzzing interfaces
llvm-svn: 316394
2017-10-23 23:19:30 +00:00
Marshall Clow ed9010a2ae Fix misguided error message in debug mode. No functional change. Fixes PR#34966
llvm-svn: 316343
2017-10-23 16:46:44 +00:00
Marshall Clow 55b9e440a7 Fix an unsigned integer overflow in regex that lead to a bad memory access. Found by OSS-Fuzz
llvm-svn: 316191
2017-10-19 22:10:41 +00:00
Marshall Clow 52f0885d43 Fix UB - signed integer overflow in regex. Thanks to Tim Shen for the patch. Reviewed as https://reviews.llvm.org/D39066
llvm-svn: 316172
2017-10-19 17:39:16 +00:00
Marshall Clow f1d1a5b4a9 Fix a think-o in the design of the stable_XXX sort tests; only shows up for test cases > 255 elements
llvm-svn: 316125
2017-10-18 20:40:57 +00:00
Marshall Clow 77623cb511 Fix regex bug with ^\W. Thanks to Tim Shen for the patch. Reviewed as https://reviews.llvm.org/D37955
llvm-svn: 316095
2017-10-18 16:49:22 +00:00
Eric Fiselier 0a412f4db0 Refactor std::list node allocation logic.
The logic to allocate a node within std::list was repeated
in a bunch of places. This is unneeded. This patch refactors
the shared logic into a single function to reduce duplication.

This patch is part of a set to clean up node construction in
general, but refactoring construction requires some more work
to make it work cleanly in C++03

llvm-svn: 316021
2017-10-17 19:12:23 +00:00
Eric Fiselier ffcc7c6c38 fix shadowing warnings in new tests, try 2
llvm-svn: 316009
2017-10-17 16:06:42 +00:00
Eric Fiselier 8092cbfbc3 fix shadowing warnings in new tests
llvm-svn: 315997
2017-10-17 13:45:20 +00:00
Eric Fiselier da0183947f Refactor _LIBCPP_<LITTLE|BIG>_ENDIAN
Previously this macro used 0/1 to indicate if it was set.
This is unlike all other libc++ configuration macros which
use ifdef/ifndef.

This patch makes this macro consistent with everything else.

llvm-svn: 315995
2017-10-17 13:16:01 +00:00
Eric Fiselier 1c0cedccb6 [libc++] Fix PR34898 - vector iterator constructors and assign method perform push_back instead of emplace_back.
Summary:
The constructors `vector(Iter, Iter, Alloc = Alloc{})` and `assign(Iter, Iter)` don't correctly perform EmplaceConstruction from the result of dereferencing the iterator. This results in them performing an additional and unneeded copy.

This patch addresses the issue by correctly using `emplace_back` in C++11 and newer.

There are also some bugs in our `insert` implementation, but those will be handled separately. 

@mclow.lists We should probably merge this into 5.1, agreed?

Reviewers: mclow.lists, dlj, EricWF

Reviewed By: mclow.lists, EricWF

Subscribers: cfe-commits, mclow.lists

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

llvm-svn: 315994
2017-10-17 13:03:17 +00:00
Roman Lebedev 622e753549 Fix last_write_time.pass.cpp to work with clang-3.9 and earlier
At least with clang-3.9 and earlier, -Wunknown-pragmas is also needed.

llvm-svn: 315882
2017-10-15 21:52:53 +00:00
Roman Lebedev 7beeee49c2 Really do make sure that last_write_time.pass.cpp still works with old clang
I *did* try to check that such kind of an issue was not introduced
by the rL315874, but clearly i failed to finish verification.

llvm-svn: 315876
2017-10-15 20:46:12 +00:00
Roman Lebedev ac9309a112 Silence clang's -Wtautological-constant-compare in last_write_time.pass.cpp
Previously this broke the builders, when D38101 was committed.
Silence the warning so that it can be re-landed.

llvm-svn: 315874
2017-10-15 20:12:42 +00:00
Benjamin Kramer 346bd6a208 Placate unused variable warnings uncovered by improvements to clang's -Wunused-variable
llvm-svn: 315809
2017-10-14 15:52:38 +00:00
Marshall Clow 2fca7aeb09 More fuzzing infastructre - regex
llvm-svn: 315582
2017-10-12 14:48:09 +00:00
Roger Ferrer Ibanez 4683ef3add Mark test as a long-test
Differential Revision: https://reviews.llvm.org/D38452

llvm-svn: 315570
2017-10-12 08:46:05 +00:00
Roger Ferrer Ibanez b1543a67a0 Remove unneeded typename from test
Differential Revision: https://reviews.llvm.org/D38628

llvm-svn: 315278
2017-10-10 07:42:19 +00:00
Shoaib Meenai 492d7134f3 [libc++] Support Microsoft ABI without vcruntime headers
The vcruntime headers are hairy and clash with both libc++ headers
themselves and other libraries. libc++ normally deals with the clashes
by deferring to the vcruntime headers and silencing its own definitions,
but for clients which don't want to depend on vcruntime headers, it's
desirable to support the opposite, i.e. have libc++ provide its own
definitions.

Certain operator new/delete replacement scenarios are not currently
supported in this mode, which requires some tests to be marked XFAIL.
The added documentation has more details.

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

llvm-svn: 315234
2017-10-09 19:25:17 +00:00
Shoaib Meenai a4a3d40eb6 [libc++] Clarify names of ABI forcing macros
Make it clear that these are intended only to force a specific ABI when
the autodetection would give the wrong result by renaming the cmake
options and adding separate forcing macros, as suggested by EricWF in
the post-commit review of r314949 and further discussed on IRC.

llvm-svn: 314965
2017-10-05 02:18:08 +00:00
Shoaib Meenai 89937534b2 [libc++] Move cache variable definition. NFC
Move it to where the other ABI cache variables/options are defined.

llvm-svn: 314950
2017-10-04 23:51:57 +00:00
Shoaib Meenai d456385043 [libc++] Allow users to explicitly specify ABI
libc++'s current heuristic for detecting Itanium vs. Microsoft ABI falls
short in some cases. For example, it will detect windows-itanium targets
as using the Microsoft ABI, since they set `_MSC_VER` (for compatibility
with Microsoft headers). Leave the current heuristic in place by default
but also allow users to explicitly specify the ABI if need be.

llvm-svn: 314949
2017-10-04 23:44:38 +00:00
Eric Fiselier 6efa277764 Fix accidental assignment inside test asserts
llvm-svn: 314947
2017-10-04 23:21:18 +00:00
Shoaib Meenai 8e62812ed3 [libc++] Add site config option for ABI macros
Some ABI macros affect headers, so it's nice to have a site config
option for them. Add a LIBCXX_ABI_DEFINES cmake macro to allow
specifying a list of ABI macros to define in the site config.

The primary design constraint (as discussed with Eric on IRC a while
back) was to not have to repeat the ABI macro names in cmake, which only
leaves a free-form cmake list as an option. A somewhat unfortunate
consequence is that we can't verify that the ABI macros being defined
actually exist, though we can at least perform some basic sanity
checking, since all the ABI macros begin with _LIBCPP_ABI_.

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

llvm-svn: 314946
2017-10-04 23:17:12 +00:00
Marshall Clow e0755113fb Initial cut at infastructure for fuzzing support for OSS-fuzz
llvm-svn: 314940
2017-10-04 22:23:03 +00:00
Eric Fiselier af65856eec Add C++17 explicit deduction guides to std::pair.
This patch adds the newly standardized deduction guides
for std::pair, allowing it to work class template deduction.

llvm-svn: 314864
2017-10-04 00:04:26 +00:00
Eric Fiselier 21cca5c2dc Fix test suite misconfiguration on OS X
llvm-svn: 314755
2017-10-03 02:25:05 +00:00
Eric Fiselier 8f1a5d39de Improve test runner output for broken configurations.
Previously LIT would often fail while attempting to set up/configure
the test compiler; normally when attempting to dump the builtin macros.
This sort of failure provided no useful information about what went
wrong with the compiler, making the actual issues hard --- if not
impossible --- to debug easily.

This patch changes the LIT configuration to report the failure explicitly,
including the failed compile command and the stdout/stderr output.

llvm-svn: 314735
2017-10-02 22:52:51 +00:00
Casey Carter 6ae59c599b [test] Allow other implementations to strengthen noexcept on deque's move constructor
llvm-svn: 314608
2017-09-30 23:15:22 +00:00
Casey Carter 0d1cfc96e5 [test] forwardlist.cons/move_noexcept.pass.cpp
* Don't forbid non-libc++ implementations from strengthening noexcept on forward_list's move constructor.

llvm-svn: 314459
2017-09-28 20:23:43 +00:00
Stephan T. Lavavej e23dde6449 [libcxx] [test] Fix unused local typedef warnings.
llvm-svn: 314259
2017-09-26 23:08:43 +00:00
Stephan T. Lavavej 326df3d819 [libcxx] [test] Strip trailing whitespace.
llvm-svn: 314258
2017-09-26 23:08:41 +00:00
Stephan T. Lavavej 1d8a407e64 [libcxx] [test] Silence warning C4324 for MSVC.
This warning "structure was padded due to alignment specifier" says
that the compiler is going to do exactly what you asked it to do.
It's triggered by the tests for over-aligned dynamic memory allocation.

llvm-svn: 314257
2017-09-26 23:08:39 +00:00
Marshall Clow 08bba64a10 Revert 313789 because gcc doesn't like it
llvm-svn: 313803
2017-09-20 19:38:43 +00:00
Marshall Clow 8f27eef230 Mark the __eval methods on independent_bits_engine (and __independent_bits_engine) as const, since they make no changes to the object. NFC.
llvm-svn: 313789
2017-09-20 18:32:08 +00:00
Marshall Clow 5beb2c3ab3 Fix a bit of UB in __independent_bits_engine. Fixes PR#34663
llvm-svn: 313776
2017-09-20 17:34:11 +00:00
Zachary Turner 3dd2356b3a Make libcxx tests work when llvm sources are not present.
Despite a strong CMake warning that this is an unsupported
libcxx build configuration, some bots still rely on being
able to check out lit and libcxx independently with no
LLVM sources, and then run lit against libcxx.

A previous patch broke that workflow, so this is making it work
again.  Unfortunately, it breaks generation of the llvm-lit
script for libcxx, but we will just have to live with that until
a solution is found that allows libcxx to make more use of
llvm build pieces.  libcxx can still run tests by using the
ninja check target, or by running lit.py directly against the
build tree or source tree.

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

llvm-svn: 313763
2017-09-20 16:01:50 +00:00
Weiming Zhao fbfaec7089 [libc++] Replace __sync_* functions with __libcpp_atomic_* functions
Summary:
This patch replaces __sync_* with __libcpp_atomic_* and adds a wrapper
function for __atomic_exchange to support _LIBCPP_HAS_NO_THREADS.

Reviewers: EricWF, jroelofs, mclow.lists, compnerd

Reviewed By: EricWF, compnerd

Subscribers: compnerd, efriedma, cfe-commits, joerg, llvm-commits

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

llvm-svn: 313694
2017-09-19 23:18:03 +00:00
Zachary Turner 50105d2942 Resubmit "Fix llvm-lit script generation in libcxx."
After speaking with the libcxx owners, they agreed that this is
a bug in the bot that needs to be fixed by the bot owners, and
the CMake changes are correct.

llvm-svn: 313643
2017-09-19 17:19:10 +00:00
Zachary Turner 0556b995e1 Revert "Fix llvm-lit script generation in libcxx."
This reverts commit 4ad71811d45268d81b60f27e3b8b2bcbc23bd7b9.

There is a bot that is checking out libcxx and lit with nothing
else and then running lit.py against the test tree.  Since there's
no LLVM source tree, there's no LLVM CMake.  CMake actually
reports this as a warning saying unsupported libcxx configuration,
but I guess someone is depending on it anyway.

llvm-svn: 313607
2017-09-19 03:11:35 +00:00
Zachary Turner cbafb0f8e1 Fix llvm-lit script generation in libcxx.
Differential Revision: https://reviews.llvm.org/D37997

llvm-svn: 313606
2017-09-19 02:46:28 +00:00
Eric Fiselier 1468677cbe Fix failing ASAN test
llvm-svn: 313576
2017-09-18 22:01:18 +00:00
Eric Fiselier 969db423c0 Fix two failing -verify tests to tolerate old and new clang versions
llvm-svn: 313502
2017-09-17 21:50:59 +00:00
Eric Fiselier 80705d8a47 Update changelog revision
llvm-svn: 313501
2017-09-17 21:00:27 +00:00
Eric Fiselier d87b880e00 ABI: Fix for undefined "___cxa_deleted_virtual" symbol in MacOSX
Patch from Eddie Elizondo. Reviewed as D37830 (https://reviews.llvm.org/D37830).

On MacOSX the following program:

struct S { virtual void f() = delete; };
int main() { new S; }
Fails with the following error:

Undefined symbols for architecture x86_64:
  "___cxa_deleted_virtual"
This adds a fix to export the needed symbols.

Test:

> lit -sv test/libcxx/language.support/cxa_deleted_virtual.pass.cpp
> Testing Time: 0.21s
>   Expected Passes    : 1

llvm-svn: 313500
2017-09-17 20:59:43 +00:00
Eric Fiselier 6b76a681dd Fix failing -verify tests due to change in Clangs static_assert message.
Clang recently changed the way it outputs static assert diagnostics.
This patch fixes libc++'s -verify tests so they tolerate both the old
and new message format.

llvm-svn: 313499
2017-09-17 20:57:05 +00:00
Shoaib Meenai 03e314bb0d [libc++] Account for Microsoft CRT const overloads
Microsoft's CRT already provides the const overloads, and it defines the
`_CRT_CONST_CORRECT_OVERLOADS` macro to indicate their presence. Check
for this macro before attempting to define our own const-correct
overloads, to avoid compiler warnings about casts dropping const
qualifiers.

llvm-svn: 313377
2017-09-15 18:49:34 +00:00
Shoaib Meenai c3f5cc8e78 [libc++] Remove unnecessary struct tag
It causes warnings about mismatched tags, and it's not needed.

llvm-svn: 313345
2017-09-15 06:19:31 +00:00
Saleem Abdulrasool e7b38cdc00 typeinfo: provide a partial implementation for Win32
The RTTI structure is different on Windows when building under MS ABI.
Update the definition to reflect this. The structure itself contains an
area for caching the undecorated name (which is 0-initialized). The
decorated name has a bitfield followed by the linkage name. When
std::type_info::name is invoked for the first time, the runtime should
undecorate the name, cache it, and return the undecorated name. This
requires access to an implementation of __unDName. For now, return
the raw name.

This uses the fnv-1a hash to hash the name of the RTTI. We could use an
alternate hash (murmur? city?), but, this was the quickest to throw
together.

llvm-svn: 313344
2017-09-15 05:42:39 +00:00
Eric Fiselier 9f8fef9504 Fix accidental ADL in std::allocator_traits meta-programming.
There were a number of cases where __double_underscore functions,
for example __has_construct_test, were called without being qualified,
causing ADL to occur. This patch qualifies those calls to avoid this
problem.

Thanks to David L. Jones for point out the issue initially.

llvm-svn: 313324
2017-09-15 00:31:38 +00:00
Shoaib Meenai 87fc45800a [libc++] Prevent stale site configuration headers
If we define cmake macros that require a site config, and then undefine
all such macros, a stale site config header will be left behind.
Explicitly delete any generate site config if we don't need one to avoid
this.

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

llvm-svn: 313284
2017-09-14 18:23:43 +00:00
Martin Storsjo fb8eb6fce8 Use CMAKE_AR instead of the system default 'ar' for merging static libraries
Using the system default 'ar' might not be the right choice when
cross compiling.

Don't prepend the ar options by a dash, not all ar implementations
support that (llvm-ar doesn't).

Also pass the 's' option when creating the merged library, to create
an index.

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

llvm-svn: 313122
2017-09-13 06:55:44 +00:00
Marshall Clow bff66aab70 Mark the new tests as unsupported when there are no exceptions
llvm-svn: 313092
2017-09-12 23:33:34 +00:00
Martell Malone f922501d98 libcxx: fix merge_archives error variable name
Differential Revision: https://reviews.llvm.org/D37728

llvm-svn: 313084
2017-09-12 22:32:02 +00:00
Martin Storsjo 499f58a548 Handle object files named *.obj in merge_archives.py
Differential Revision: https://reviews.llvm.org/D37133

llvm-svn: 313072
2017-09-12 20:54:15 +00:00
Marshall Clow c589f5f875 XFAIL a couple of new <regex> tests for C++03
llvm-svn: 313064
2017-09-12 19:01:32 +00:00
Marshall Clow 5a72679338 Apply D28224: 'Throw exception after too many steps' Fixes PR#20291. Thanks to Tim Shen for the patch
llvm-svn: 313056
2017-09-12 17:56:59 +00:00
Marshall Clow d90758e2ef Make pbump (internally) handle sizes bigger than MAX_INT. Fixes PR#33725 - thanks to Jonathan Wakely for the report
llvm-svn: 313031
2017-09-12 15:00:43 +00:00
Marshall Clow 31372681be mark mersenne_twister_engine<>::seed(result_type __sd) with _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK to placate UBSAN. Fixes PR#34160
llvm-svn: 312932
2017-09-11 18:10:33 +00:00
Marshall Clow bc455478e1 Add include of <string> to <system_error>, since things in there return strings. Fixes PR#34529.
llvm-svn: 312923
2017-09-11 16:05:42 +00:00
Eric Fiselier 94d555116c Fix PR34298 - Allow std::function with an incomplete return type.
This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated
the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function]
whenever the copy constructor or copy assignment operator
was required. This patch further constrains that constructor to short
circut before evaluating the troublesome SFINAE when `Tp` matches
std::function.

The original patch is from Alex Lorenz.

llvm-svn: 312892
2017-09-10 23:41:20 +00:00
Eric Fiselier 85cde7d2f4 Revert "Fix PR34298 - Allow std::function with an incomplete return type."
This reverts commit r312890 because the test case fails to compile for
older versions of Clang that reject initializing a const object without
a user defined constructor.

Since this patch should go into 5.0.1, I want to keep it an atomic change,
and will re-commit it with a fixed test case.

llvm-svn: 312891
2017-09-10 23:37:47 +00:00
Eric Fiselier 358ca0c04b Fix PR34298 - Allow std::function with an incomplete return type.
This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated
the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function]
whenever the copy constructor or copy assignment operator
was required. This patch further constrains that constructor to short
circut before evaluating the troublesome SFINAE when `Tp` matches
std::function.

The original patch is from Alex Lorenz.

llvm-svn: 312890
2017-09-10 23:12:33 +00:00
Brian Cain 086b6682dd XFAIL tests on SLES11
XFAIL some failing tests for SLES11 (older glibc), also replace spaces
in linux distro w/dashes.

llvm-svn: 312774
2017-09-08 03:57:02 +00:00
Marshall Clow 064028bb05 Add even more string_view tests. These found some bugs in the default parameter value for rfind/find_last_of/find_last_not_of
llvm-svn: 312693
2017-09-07 04:19:32 +00:00
Marshall Clow e2addb79b8 Another missing string_view test
llvm-svn: 312691
2017-09-07 03:03:48 +00:00
Marshall Clow b6d73126c8 Add more string_view tests
llvm-svn: 312690
2017-09-07 02:46:09 +00:00
Martin Storsjo f8689b1be1 Redirect strftime_l to the locale-ignorant strftime on mingw
_strftime_l is only available in the numbered msvcrt versions
(starting from msvcr80.dll). In the default configuration, mingw
targets the unversioned msvcrt.dll - and there, _strftime_l is
not available (not even on windows 10).

If __MSVCRT_VERSION__ is set to a higher value (indicating a
non-default target and wanting to link to msvcrXX.dll), use the
correct function.

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

llvm-svn: 312617
2017-09-06 05:07:25 +00:00
Martin Storsjo 783d433f16 Add MINGW_LIBRARIES to the linker flags
This is essential when building with -nodefaultlibs.

This is similar to what already is done in libcxxabi in SVN r302760.

Differential revision: https://reviews.llvm.org/D37207

llvm-svn: 312498
2017-09-04 19:46:53 +00:00
Stephan T. Lavavej 6f297ba8a9 [libcxx] [www] Change an absolute link to cxx1z_status.html to be relative.
Fixes D37318.

llvm-svn: 312263
2017-08-31 17:59:51 +00:00
Stephan T. Lavavej 9c88eeb68d [libcxx] [www] Strip trailing whitespace.
Fixes D37318.

llvm-svn: 312262
2017-08-31 17:59:48 +00:00
Stephan T. Lavavej 98fa5d4a97 [libcxx] [www] Fix broken link for LLVM Bugzilla.
Fixes D37318.

llvm-svn: 312261
2017-08-31 17:59:46 +00:00
Stephan T. Lavavej 69c2e1336f [libcxx] [www] Manually change http links to https.
Fixes D37318.

llvm-svn: 312260
2017-08-31 17:59:42 +00:00
Stephan T. Lavavej 907c1ab603 [libcxx] [www] Semi-manually change http://www.open-std.org and http://isocpp.org papers to https://wg21.link .
Fixes D37318.

llvm-svn: 312259
2017-08-31 17:59:39 +00:00
Stephan T. Lavavej 1dc1fa2347 [libcxx] [www] Change http://cplusplus.github.io/LWG/lwg-defects.html# to https://wg21.link/lwg .
Fixes D37318.

llvm-svn: 312258
2017-08-31 17:59:36 +00:00
Stephan T. Lavavej 2956ea46cd [libcxx] [www] Change http://wg21.link to https://wg21.link .
Fixes D37318.

llvm-svn: 312257
2017-08-31 17:59:33 +00:00
Casey Carter e38efe12da [test] Cleanup nullopt_t tests
* Update specification text from N4387

* Delete not_brace_initializable.fail.cpp: it's redundant with nullopt_t.fail.cpp

* is_empty<T> implies is_class<T>

* is_literal is deprecated; directly verify that we can create a nullopt_t in a constexpr context

Differential Revision: D37024

llvm-svn: 312256
2017-08-31 17:56:31 +00:00
Marshall Clow 589453458d Fix test for C++03
llvm-svn: 311967
2017-08-29 01:10:51 +00:00
Marshall Clow a763b36ff4 Fix PR31166: std::inplace_merge seems to be unstable. Thanks to Jan Wilken Dörrie for the suggested fix.
llvm-svn: 311952
2017-08-28 23:16:13 +00:00
Stephan T. Lavavej bc933768a6 [libcxx] [test] Update for C++17 feature removals.
test/std/containers/Emplaceable.h
test/std/containers/NotConstructible.h
test/support/counting_predicates.hpp
Replace unary_function/binary_function inheritance with typedefs.

test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp
test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp
test/std/utilities/function.objects/func.require/binary_function.pass.cpp
test/std/utilities/function.objects/func.require/unary_function.pass.cpp
Mark these tests as requiring 98/03/11/14 because 17 removed unary_function/binary_function.

test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp
test/std/thread/futures/futures.task/futures.task.nonmembers/uses_allocator.pass.cpp
Mark these tests as requiring 11/14 because 17 removed packaged_task allocator support.

test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp
This test doesn't need to be skipped in C++17 mode. Only the construction of
std::function from an allocator needs to be skipped in C++17 mode.

test/std/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp
When testing these reference_wrapper features, unary_function inheritance is totally irrelevant.

test/std/utilities/function.objects/refwrap/weak_result.pass.cpp
Define and use my_unary_function/my_binary_function to test the weak result type machinery
(which is still present in C++17, although deprecated).

test/support/msvc_stdlib_force_include.hpp
Now we can test C++17 strictly, without enabling removed features.

Fixes D36503.

llvm-svn: 311705
2017-08-24 21:24:08 +00:00
Aditya Kumar 6c9ce223ea [NFC] remove trailing WS
llvm-svn: 311283
2017-08-20 10:38:55 +00:00
Joerg Sonnenberger 7e680f15a5 Spelling
llvm-svn: 311156
2017-08-18 12:57:36 +00:00
Stephan T. Lavavej 709be5eef2 [libcxx] [test] Rename _Up to U, etc. NFCI.
This improves readability and (theoretically) improves portability,
as _Ugly names are reserved.

This performs additional de-uglification, so all of these tests
follow the example of iterator.traits/empty.pass.cpp.

llvm-svn: 310761
2017-08-11 20:54:09 +00:00
Stephan T. Lavavej ed76ab3f1c [libcxx] [test] Rename __x to x. NFCI.
This improves readability and (theoretically) improves portability,
as __ugly names are reserved.

llvm-svn: 310760
2017-08-11 20:54:06 +00:00
Stephan T. Lavavej 55467c4685 [libcxx] [test] Rename __c to ch. NFCI.
This improves readability and (theoretically) improves portability,
as __ugly names are reserved.

llvm-svn: 310759
2017-08-11 20:54:01 +00:00
Stephan T. Lavavej aae63566dc [libcxx] [test] Rename _Tp to T. NFCI.
This improves readability and (theoretically) improves portability,
as _Ugly names are reserved.

llvm-svn: 310758
2017-08-11 20:53:53 +00:00
Marshall Clow 162484f7da Change the way the literal operators are defined - now w/o a seperating space. This should be a NFC, but it will change how the compiler parses it.
llvm-svn: 310487
2017-08-09 15:42:50 +00:00
Shoaib Meenai 9b8ef6e55a [libc++] Don't hardcode namespace in manual mangling
libc++'s inline namespace can change depending on the ABI version.
Instead of hardcoding __1 in the manual Microsoft ABI manglings for the
iostream globals, stringify _LIBCPP_NAMESPACE and use that instead, to
work across all ABI versions.

llvm-svn: 310290
2017-08-07 19:59:58 +00:00