Commit Graph

4344 Commits

Author SHA1 Message Date
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