Commit Graph

4220 Commits

Author SHA1 Message Date
Stephan T. Lavavej f85e2e218a [libcxx] [test] Remove an unused local typedef in enable_shared_from_this.pass.cpp.
Trivial change, committed without review.

llvm-svn: 309322
2017-07-27 21:16:37 +00:00
Marshall Clow 4d82e40310 Disable the deduction guide test I added in 309296 for the moment, while I figure out which compilers don't support deduction guides
llvm-svn: 309307
2017-07-27 18:47:35 +00:00
Marshall Clow 88c893cc33 Implement P0739R0: 'Some improvements to class template argument deduction integration into the standard library' This is an API change (not ABI change) due to a late change in the c++17 standard
llvm-svn: 309296
2017-07-27 17:44:03 +00:00
Rachel Craik 3e2ef40812 Remove addtional parameters in function std::next() and std::prev()
Creating a function pointer with proper parameters pointing to std::next() or std::prev() should work.
This change moves the invented paramater for enable_if over to the return type to resolve this QoI issue.

Patch by Jason Liu.

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

llvm-svn: 308932
2017-07-24 22:17:05 +00:00
Marshall Clow e5cc2fcc90 make sure that we don't call basic_streambuf::gbump with a value bigger than INT_MAX, since it only takes an int. Related to, but not quite the same as PR33725
llvm-svn: 308880
2017-07-24 14:05:10 +00:00
Nico Weber 7fa845e713 Fix grammar-o in comment.
llvm-svn: 308827
2017-07-22 15:16:42 +00:00
Stephan T. Lavavej 9587bcfd79 [libcxx] [test] Update msvc_stdlib_force_include.hpp.
MSVC's STL is replacing _HAS_FUNCTION_ASSIGN with _HAS_FUNCTION_ALLOCATOR_SUPPORT,
and is adding _HAS_UNEXPECTED.

llvm-svn: 308535
2017-07-19 22:02:33 +00:00
Stephan T. Lavavej b1ba797d0d [libcxx] [test] Fix Clang -Wunused-local-typedef warnings.
Fix D34536.

llvm-svn: 308534
2017-07-19 22:02:29 +00:00
Stephan T. Lavavej 73f9077721 [libcxx] [test] Fix MSVC warning C4067 "unexpected tokens following preprocessor directive - expected a newline".
Also fixes Clang/LLVM 4.0 (for Windows) error "function-like macro 'TEST_GLIBC_PREREQ' is not defined".

Fixes D34535.

llvm-svn: 308533
2017-07-19 22:02:25 +00:00
Stephan T. Lavavej 14e60beb71 [libcxx] [test] Fix MSVC warning C4242 "conversion from 'int' to 'const char', possible loss of data".
Fixes D34534.

llvm-svn: 308532
2017-07-19 22:02:22 +00:00
James Y Knight 929f159777 Rework libcxx strerror_r handling.
The set of #ifdefs used to handle the two incompatible variants of
strerror_r were not complete (they didn't handle newlib appropriately).

Rather than attempting to make the ifdefs more complex, make them
unnecessary by choosing which behavior to use dependent upon the
return type.

Reviewers: waltl

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

llvm-svn: 308528
2017-07-19 21:48:49 +00:00
Hans Wennborg 9e82a506ae Update _LIBCPP_VERSION and the version in CMakeLists to 6.0
llvm-svn: 308468
2017-07-19 13:57:10 +00:00
Hans Wennborg dd2f4e0288 Bump docs version to 6.0
llvm-svn: 308462
2017-07-19 13:46:11 +00:00
Leo Li 95e45f9f93 [CMake] Use MATCHES for regular expression.
Subscribers: mgorny

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

llvm-svn: 308347
2017-07-18 19:48:02 +00:00
Bruno Cardoso Lopes e59dd00038 Check for _MSC_VER before defining _LIBCPP_MSVCRT
Some targets (e.g. Darwin) might have the Win32 API available, but they
do not use MSVC CRT. Assume _LIBCPP_MSVCRT only when _MSC_VER is available
and __MINGW32__ isn't defined.

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

rdar://problem/32628786

llvm-svn: 308225
2017-07-17 21:52:31 +00:00
Marshall Clow 33116350ad Add case for c++2a to libc++ and test macros
llvm-svn: 308159
2017-07-17 03:02:27 +00:00
Marshall Clow 5820ae49ab Update libc++ status pages with results of the Toronto Meeting - and for C++2a
llvm-svn: 308153
2017-07-16 23:59:23 +00:00
Marshall Clow d994e3f35d Update issues moved in Toronto
llvm-svn: 308097
2017-07-15 15:22:21 +00:00
Shoaib Meenai 316a3e572e [libc++] Clean up cl warning 4231 disabling
Once upon a time, extern templates used to be a Microsoft extension, so
cl would warn about their usage, and libc++ suppressed that warning.
They've long since been standardized, so the warning is defunct. (libc++
also doesn't currently support building with cl anyway.)

llvm-svn: 307997
2017-07-14 03:56:54 +00:00
Shoaib Meenai 24767a7c2f [libc++] class template -> template class. NFC
llvm-svn: 307972
2017-07-13 22:08:59 +00:00
Shoaib Meenai 5b67cd3567 [libc++] Mark string operator+ _LIBCPP_FUNC_VIS
It has an extern template instantiation declaration in the headers and a
corresponding instantiation definition in the library, so we must mark
it with _LIBCPP_FUNC_VIS to make it available outside the library.

This doesn't cause any ABI changes as-is since we don't build libc++
with hidden visibility (so the function is exported anyway). It's needed
for building libc++ with hidden visibility, however.

Clarify the Windows behavior for extern function templates while I'm
here, since this exercises that behavior.

llvm-svn: 307966
2017-07-13 21:35:52 +00:00
Shoaib Meenai c44edbcc94 [libc++] Remove unused _LIBCPP_FUNC_VIS_ONLY
This has been unused since r282644.

llvm-svn: 307965
2017-07-13 21:28:17 +00:00
Shoaib Meenai 982060b0a4 [libc++] Use proper template terminology. NFC
It's supposed to be "class template" and "function template" instead of
"template class" and "template function".

llvm-svn: 307954
2017-07-13 20:47:24 +00:00
Ben Craig 7e17e52b87 Fix unrepresentable enum for clang-cl unstable ABI
When using LIBCXX_ABI_UNSTABLE=YES, clang-cl gave the following warning:

P:\llvm_master\src\llvm\projects\libcxx\include\string(683,51):
warning: enumerator value is not representable in the underlying type
'int' [-Wmicrosoft-enum-value]

Fixed by switching from enums to static const size_type.

https://reviews.llvm.org/D35174

llvm-svn: 307751
2017-07-12 01:45:13 +00:00
Eric Fiselier e3e7c0fb37 Remove <__refstring> header; Move it into source directory.
The libc++ <__refstring> headers has no real reason why it should
be a public header that libc++ ships. The only reason it was in the include
directory was because libc++abi needed it to build the library.

However keeping <__refstring> a header had other problems, like requiring its
dependancies to also be in the headers. For that reason this patch
moves it into the source directory.

To work around libc++abi's need for this header a duplicated copy was added
to libc++abi in r307748. While duplicating the code is an unfortunate solution
it's the best solution that's currently possible.

In the future I would like to start a discussion on the mailing lists about
making libc++abi build as a sub-project of libc++, requiring the libc++ sources
always be present.

llvm-svn: 307749
2017-07-12 01:38:35 +00:00
Eric Fiselier e82f49849b Revert "[libc++] Refactoring __sync_* builtins; NFC (Reland)"
This reverts commit r307595. The commit had some issues that needed
to first be addressed in review.

llvm-svn: 307746
2017-07-12 01:16:33 +00:00
Petr Hosek 510e70fdd5 [libcxx][CMake] Add install path variable to allow overriding the destination
This is going to be used by the runtime build in the multi-target
setup to allow using different install prefix for each target.

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

llvm-svn: 307615
2017-07-11 02:39:50 +00:00
Weiming Zhao f7850fa8b6 [libc++] Refactoring __sync_* builtins; NFC (Reland)
Summary: Wrap __sync_* builtins with __libcpp_ functions to facility future customizations as atomic operations are unavailable on some targets.

Reviewers: danalbert, EricWF, jroelofs

Subscribers: joerg, llvm-commits

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

llvm-svn: 307595
2017-07-10 21:37:35 +00:00
Weiming Zhao ba5b8c8ee7 Revert "[libc++] Refactoring __sync_* builtins; NFC"
This reverts commit 72ff8866bca49ee7d24c87673293b4ce88a039ec.

llvm-svn: 307593
2017-07-10 21:23:32 +00:00
Weiming Zhao 07f6efddc0 [libc++] Refactoring __sync_* builtins; NFC
Summary: Wrap __sync_* builtins with __libcpp_ functions to facility future customizations as atomic operations are unavailable on some targets.

Reviewers: danalbert, EricWF, jroelofs

Subscribers: joerg, llvm-commits

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

llvm-svn: 307591
2017-07-10 21:02:54 +00:00
Eric Fiselier 766233b153 Fix issues with UBSAN test configuration.
On Apple the test feature 'sanitizer-new-delete' was incorrectly
getting added to the LIT feature set, which mistakenly caused tests
to be disabled when using UBSAN (the feature is only needed with ASAN/MSAN/TSAN).

llvm-svn: 307518
2017-07-10 04:32:21 +00:00
Eric Fiselier cc859306f4 Work around PR31864 - ATOMIC_LLONG_LOCK_FREE is incorrect in 32 bit builds
llvm-svn: 307517
2017-07-10 04:16:50 +00:00
Eric Fiselier 52f2683695 Fix test failure to to new/delete ellisions
llvm-svn: 307510
2017-07-09 22:20:07 +00:00
Casey Carter f2d571c8ac optional: Implement LWG 2900 and P0602
Differential Revision: https://reviews.llvm.org/D32385

llvm-svn: 307505
2017-07-09 17:15:49 +00:00
Eric Fiselier 433c2f0859 Fix filesystem build on platforms with weird time_t types.
32-bit powerpc provides a 64 bit time_t type and older ppc64 systems
provide time_t as a floating point type. This caused problems when building
operations.cpp since operations.cpp contained compile time tests for conversions
between time_t and filesystem time type.

When these tests failed they caused the libc++ build to fail as well. This is unfortunate.

This patch moves the tests out of the source file and into the test suite. It also
expands the tests to allow testing of the weird time_t configurations on all platforms.

llvm-svn: 307461
2017-07-08 04:18:41 +00:00
Eric Fiselier f29a1b921c Fix diagnostic in verify test to match new Clang output
llvm-svn: 307450
2017-07-07 23:02:30 +00:00
Duncan P. N. Exon Smith 66631a12b8 cmath: Support clang's -fdelayed-template-parsing
r283051 added some functions to cmath (in namespace std) that have the
same name as functions in math.h (in the global namespace).  Clang's
limited support for `-fdelayed-template-parsing` chokes on this.  Rename
the ones in `cmath` and their uses in `complex` and the test.

rdar://problem/32848355

llvm-svn: 307357
2017-07-07 05:13:36 +00:00
Eric Fiselier 226dbd78eb Suppress -Waligned-allocation-unavailable warning in libc++ test suite
llvm-svn: 307218
2017-07-05 22:40:58 +00:00
Marshall Clow 52f4f72fa9 Fix a bug in regex_Iterator where it would report zero-length matches forever. Reported as http://llvm.org/PR33681. Thanks to Karen Arutyunov for the report.
llvm-svn: 307171
2017-07-05 16:37:19 +00:00
Eric Fiselier 57495596bd Fix equivalent test on OS X and FreeBSD
llvm-svn: 307119
2017-07-05 03:54:38 +00:00
Eric Fiselier 635430895a Add dummy CMake target for *.pass.cpp tests when LIBCXX_CONFIGURE_IDE=ON.
In order for IDE's like CLion to correctly parse and highlight the tests
it needs to know roughly how to build them. This patch adds a dummy CMake target
for each/all of the .pass.cpp tests in the test suite to solve this problem.
The target is only created when LIBCXX_CONFIGURE_IDE=ON, so it shouldn't affect
most users.

Originally I wasn't sure that this change deserved to live upstream, but it's
quite frustrating to edit libc++ tests using CLion or Visual Studio without it,
in particular the filesystem tests which rely heavily on macros. Even though the change
should have no effect on non-IDE users/configurations I decided to commit it upstream
with the hopes it will benefit somebody other than me.

llvm-svn: 307118
2017-07-05 03:50:03 +00:00
Eric Fiselier 459877388b Implement LWG 2937 - equivalent("dne", "exists") is not an error
This patch speculatively implements the PR for LWG 2937, which fixes
two issues with equivalent.

(1) It makes equivalent("dne", "exists") an error. Previously only
    equivalent("dne", "dne") was an error and the former case was not (it returned false).
    Now equivalent reports an error when either input doesn't exist.

(2) It makes equivalent(p1, p2) well-formed when `is_other(p1) && is_other(p2)`.
    Previously this was an error, but there is seemingly no reason why it should be on POSIX system.

llvm-svn: 307117
2017-07-05 03:37:05 +00:00
Akira Hatanaka 539cb66bea Revert "[libcxx] Annotate c++17 aligned new/delete operators with availability"
This reverts commit r306310.

r306310 causes clang to reject a call to an aligned allocation or
deallocation function if it is not implemented in the standard library
of the deployment target. This is not the desired behavior when users
have defined their own aligned functions.

rdar://problem/32664169

llvm-svn: 306859
2017-06-30 18:50:23 +00:00
David L. Jones 8e293f15db [lit/libcxx] Fix a remaining reference to lit.util.capture() in custom libcxx/Darwin code.
Summary:
This reference to lit.util.capture is functionally identical to
subprocess.check_output, so this change switches to call the library routine
directly.

Reviewers: mzolotukhin, EricWF

Reviewed By: mzolotukhin

Subscribers: sanjoy, llvm-commits

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

llvm-svn: 306755
2017-06-29 23:07:27 +00:00
Shoaib Meenai 8e07cadde0 [libc++] Hoist explicit instantiation above implicit. NFC
The string literal operators have implicit instantiations of
basic_string<char> and basic_string<wchar>, which prevent the dllimport
on the subsequent explicit instantiation declarations from having an
effect. Hoisting the explicit instantiations above the implicit ones
fixes the issue.

I think it's pretty unfortunate that the ordering has such an effect,
and I'd fixed the same issue for dllexport in r288682. dllimport is more
complicated from a codegen perspective, however, and clang's behavior of
ignoring the dllimport when there's a previous implicit instantiation is
consistent with cl, so changing the order is our only recourse.

llvm-svn: 306632
2017-06-29 02:52:46 +00:00
Marshall Clow 797bcb40e3 Updated notest on 2974
llvm-svn: 306581
2017-06-28 18:19:34 +00:00
Marshall Clow f8c16417a9 Added failing tests for index out of range for tuple_element<pair<T1,T2>> and variant_alternative<>
llvm-svn: 306580
2017-06-28 18:18:30 +00:00
Akira Hatanaka 393b55ffe2 [libcxx] Annotate c++17 aligned new/delete operators with availability
attribute.

This is needed because older versions of libc++ do not have these
operators. If users target an older deployment target and try to compile
programs in which these operators are explicitly called, the compiler
will complain.

The following is the list of minimum deployment targets for the four
OSes:

macosx: 10.13
ios: 11.0
tvos: 11.0
watchos: 4.0

rdar://problem/32664169

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

llvm-svn: 306310
2017-06-26 17:39:48 +00:00
Marshall Clow 77957d19f8 Updated for the Toronto meeting
llvm-svn: 306269
2017-06-26 04:25:15 +00:00
Marshall Clow ac8ea7c6ff Implement inclusive_scan/transform_inclusive_scan for C++17.
llvm-svn: 306083
2017-06-23 05:12:42 +00:00