Commit Graph

4229 Commits

Author SHA1 Message Date
Eric Fiselier 6301546b3d Mark LWG 2942 as complete
llvm-svn: 309528
2017-07-30 22:28:08 +00:00
Eric Fiselier 1190335f9d Mark LWG 2961 as complete
llvm-svn: 309527
2017-07-30 22:16:30 +00:00
Shoaib Meenai 191b7d18f1 [libc++] Hoist extern template above first use
This function template is referenced inside class basic_string as a
friend function. The extern template declaration needs to be above that
friend declaration to actually take effect.

This is important because this function was marked as exported in
r307966, so without the extern template taking effect, it can leak into
other DSOs as a visible symbol.

llvm-svn: 309474
2017-07-29 02:54:41 +00:00
Stephan T. Lavavej 9ea675ef8c [libcxx] [test] Change comments to say C++ instead of c++. NFC.
This makes them consistent (many comments already used uppercase).

The special REQUIRES, UNSUPPORTED, and XFAIL comments are excluded from this change.

llvm-svn: 309468
2017-07-29 00:55:35 +00:00
Stephan T. Lavavej ca15aa1b70 [libcxx] [test] The entire file futures.shared_future/wait_until.pass.cpp was indented by 1 space. NFC.
llvm-svn: 309467
2017-07-29 00:55:27 +00:00
Stephan T. Lavavej 05f99df8e2 [libcxx] [test] In func.wrap.func.con/alloc_F.pass.cpp, fix REQUIRES whitespace. NFC.
llvm-svn: 309466
2017-07-29 00:55:25 +00:00
Stephan T. Lavavej d29b12ef7c [libcxx] [test] Make files consistently end with newlines, NFC.
llvm-svn: 309465
2017-07-29 00:55:22 +00:00
Stephan T. Lavavej 4159db7698 [libcxx] [test] Untabify, NFC.
llvm-svn: 309464
2017-07-29 00:55:10 +00:00
Stephan T. Lavavej 8980b8ad9c [libcxx] [test] Strip trailing whitespace, NFC.
llvm-svn: 309463
2017-07-29 00:54:49 +00:00
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