summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
* Add missing include in <numeric>Eric Fiselier2017-02-081-0/+1
| | | | llvm-svn: 294393
* Prevent UBSAN from generating unsigned overflow diagnostics in the hashing ↵Eric Fiselier2017-02-083-10/+76
| | | | | | internals llvm-svn: 294391
* Fix bugs in filesystem detected by _LIBCPP_ASSERT.Eric Fiselier2017-02-072-7/+16
| | | | | | | | | | | | | | | | | Recently I turned on libc++'s debug mode assertions when CMake is configured with -DLIBCXX_ENABLE_ASSERTIONS=ON. This change exposed assertion failures caused by bugs in filesystem. This patch fixes those failures. The first bug was that `PathParser` was using front()/back() on empty string views in order to get the address of the character. However this is UB on empty strings. Those operations now use data() to obtain the pointer. The second bug was that directory_iterator attempted to capture errno when it was unset and there was an assertion to detect this. llvm-svn: 294360
* fix python3 syntax errorEric Fiselier2017-02-071-1/+1
| | | | llvm-svn: 294355
* Fix test failures when using modules.Eric Fiselier2017-02-078-0/+19
| | | | llvm-svn: 294353
* Use copy.deepcopy instead of doing it manually.Dan Albert2017-02-072-14/+3
| | | | | | | | | | | | Reviewers: EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29209 llvm-svn: 294350
* Stop using random_shuffle in the libc++ test suite. It's going to be removed ↵Marshall Clow2017-02-0729-37/+124
| | | | | | in c++17. Use shuffle() instead. No change to libc++, just the tests. llvm-svn: 294328
* Mark LWG2784 as readyMarshall Clow2017-02-071-2/+2
| | | | llvm-svn: 294311
* filesystem: return the constructed objectSaleem Abdulrasool2017-02-071-5/+2
| | | | | | | | This really should get identified properly by the compiler to convert to a NVRO, but compress the code anyways. This makes the implementation identical to directory_iterator.cpp llvm-svn: 294270
* Add some tests to verify that we implement LWG#2837 correctly. No functional ↵Marshall Clow2017-02-063-2/+16
| | | | | | change. llvm-svn: 294194
* Fix a typo - extra '>'Marshall Clow2017-02-061-2/+2
| | | | llvm-svn: 294190
* Set up 'upcoming meeting' bug listMarshall Clow2017-02-061-151/+59
| | | | llvm-svn: 294189
* Refer to _LIBCPP_MSVC macro where applicableSaleem Abdulrasool2017-02-067-13/+13
| | | | | | | | | Replace preprocess conditions of defined(_MSC_VER) && !defined(__clang__) with defined(_LIBCPP_MSVC). NFC. Patch by Dave Lee! llvm-svn: 294171
* Mark LWG 2765 as complete. No changes neededEric Fiselier2017-02-061-1/+1
| | | | llvm-svn: 294167
* Implement LWG 2773 - std::ignore should be constexpr.Eric Fiselier2017-02-064-4/+83
| | | | | | | | In addition to the PR for LWG 2773 this patch also ensures that each of std::ignores constructors or assignment operators are constexpr. llvm-svn: 294165
* [libcxx] [test] Strip trailing whitespace.Stephan T. Lavavej2017-02-053-5/+5
| | | | | | No functional change, no code review. llvm-svn: 294161
* [libcxx] [test] Fix comment typos.Stephan T. Lavavej2017-02-054-7/+7
| | | | | | No functional change, no code review. llvm-svn: 294160
* [libcxx] [test] Avoid MSVC's non-Standard ABI in underlying_type.pass.cpp.Stephan T. Lavavej2017-02-051-9/+17
| | | | | | | | | | | | When compiled with Clang for Windows, this was emitting "enumerator value evaluates to 4294967295, which cannot be narrowed to type 'int' [-Wc++11-narrowing]". The test should more strenuously avoid poking this ABI deficiency (and it already has coverage for explicitly specified underlying types). Fixes D29140. llvm-svn: 294159
* [libcxx] [test] Fix Clang -Wpessimizing-move "moving a temporary object ↵Stephan T. Lavavej2017-02-051-6/+6
| | | | | | | | | | prevents copy elision". N4618 30.6.6 [futures.unique_future]/12 declares "shared_future<R> share() noexcept;". Fixes D29139. llvm-svn: 294158
* [libcxx] [test] Fix Clang -Wdeprecated-declarations with MSVC's CRT.Stephan T. Lavavej2017-02-051-20/+20
| | | | | | | | | | | | | | | | libcxx's tests use various C Standard Library functions that have been marked by MSVC's CRT as deprecated by Microsoft (not by ISO). libcxx's usage is cromulent (just checking with decltype to see if the functions are being dragged in by various headers as required by the Standard), so defining _CRT_SECURE_NO_WARNINGS will silence the warnings in a targeted manner. This needs to be defined before including any CRT headers. Also, make this file prettier. Fixes D29138. llvm-svn: 294157
* [libcxx] [test] Fix Clang -Wunused-local-typedef, part 3/3.Stephan T. Lavavej2017-02-053-7/+6
| | | | | | | | | | | | | | | | test/std/strings/string.classes/typedefs.pass.cpp Actually test what basic_string's typedefs stand for. test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp NotDerived and ND were completely unused. test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp P2 was mistakenly not being used. Yes, that's right: -Wunused-local-typedef CAUGHT A MISTAKE! AMAZING! Fixes D29137. llvm-svn: 294156
* [libcxx] [test] Fix Clang -Wunused-local-typedef, part 2/3.Stephan T. Lavavej2017-02-0537-103/+0
| | | | | | | | These typedefs were completely unused. Fixes D29136. llvm-svn: 294155
* [libcxx] [test] Fix Clang -Wunused-local-typedef, part 1/3.Stephan T. Lavavej2017-02-0569-149/+311
| | | | | | | | | | | | | | | | | Guard typedefs and static_asserts with _LIBCPP_VERSION. test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp Additionally deal with conditional compilation. test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp Additionally deal with typedefs used by other typedefs. Fixes D29135. llvm-svn: 294154
* Restore the _NOEXCEPT on the dtor of bad_optional_access. Destructors are ↵Marshall Clow2017-02-053-4/+4
| | | | | | noexcept by default, so it's not really needed, but the other exception classes have the _NOEXCEPT, and gcc complains if these are missing. I think we should remove them all - but not today. llvm-svn: 294142
* Fix variant build errors with GCC 7Eric Fiselier2017-02-051-2/+1
| | | | llvm-svn: 294141
* Adjust Apple ABI list after r294133Eric Fiselier2017-02-051-0/+1
| | | | llvm-svn: 294139
* Adjust Linux ABI list after r294133Eric Fiselier2017-02-051-1904/+1905
| | | | llvm-svn: 294138
* Change the base class of std::bad_optional_access. This is a (subtle) ABI ↵Marshall Clow2017-02-054-11/+13
| | | | | | change, and is in response to http://http://wg21.link/LWG2806, which I *expect* to be adopted in Kona. I am making this change now in anticipation, and will get it into 4.0, because (a) 4.0 is the first release with std::optional, and (b) I don't want to make an ABI-change later, when the user base should be significantly larger. Note that I didn't change std::experimental::bad_optional_access, because that's still specified to derive from std::logic_error. llvm-svn: 294133
* filesystem: fix n4100 conformance for `temp_directory_path`Saleem Abdulrasool2017-02-052-14/+27
| | | | | | | | | N4100 states that an error shall be reported if `!exists(p) || !is_directory(p)`. We were missing the first half of the conditional. Invert the error and normal code paths to make the code easier to follow. llvm-svn: 294127
* Remove CMake hackEric Fiselier2017-02-051-9/+0
| | | | llvm-svn: 294116
* Fix typo in docsEric Fiselier2017-02-051-1/+1
| | | | llvm-svn: 294115
* Recommit [libcxx] Never use <cassert> within libc++Eric Fiselier2017-02-047-13/+9
| | | | | | | | | | It is my opinion that libc++ should never use `<cassert>`, including in the `dylib`. This patch remove all uses of `assert` from within libc++ and replaces most of them with `_LIBCPP_ASSERT` instead. Additionally this patch turn `LIBCXX_ENABLE_ASSERTIONS` off by default, because the standard library should not be aborting user programs unless explicitly asked to. llvm-svn: 294107
* Fix inconsistency in tuple's SFINAE. Patch from Andrey Khalyavin"Eric Fiselier2017-02-041-1/+1
| | | | llvm-svn: 294106
* Mark basic_string::assign templates as inline to improve ABI stability.Eric Fiselier2017-02-041-2/+2
| | | | | | | | | | | | Visible definitions for basic_string::assign are sometimes emitted in the dylib depending on the version of LLVM used to compile libc++. This can cause the check-cxx-abilist target to fail. This patch attempts marks the basic_string::assign templates as inline to prevent this. That way the export list is consistent across LLVM versions. llvm-svn: 294100
* Undefine min/max in __treeEric Fiselier2017-02-042-0/+24
| | | | llvm-svn: 294099
* Avoid implementation defined behavior in a test.Dan Albert2017-02-021-1/+7
| | | | | | | | | | | | | | | | | Summary: num_put::put uses %p for pointer types, but the exact format of %p is implementation defined behavior for the C library. Compare output to snprintf for portability. Reviewers: EricWF, mclow.lists Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29197 llvm-svn: 293926
* Extend XFAIL to c++98.Asiri Rathnayake2017-02-021-1/+1
| | | | | | NFC. llvm-svn: 293881
* Fix up some no-exception compile failuresMarshall Clow2017-01-311-11/+11
| | | | llvm-svn: 293623
* Workaround new -Wshadow warning introduced by r293599Alex Lorenz2017-01-311-1/+1
| | | | llvm-svn: 293619
* Fix PR#31779: basic_string::operator= isn't exception safe.Marshall Clow2017-01-312-4/+101
| | | | llvm-svn: 293599
* Revert "Adorn __call_once_proxy with `inline` and `_LIBCPP_INLINE_VISIBILITY`"Justin Bogner2017-01-311-1/+0
| | | | | | | | | | | | | | | While this change didn't really hurt, it does lead to spurious warnings about not being able to override weak symbols if you end up linking objects built with this change to ones built without it. Furthermore, since __call_once_proxy is called indirectly anyway it doesn't actually inline ever. Longer term, it would probably make sense to give this symbol internal visibility instead. This reverts r291497 llvm-svn: 293581
* experimental: avoid using raw _WIN32 in filesystemSaleem Abdulrasool2017-01-301-5/+6
| | | | | | | Use the _LIBCPP_WIN32API macro instead of _WIN32 checks. Fix a missed renaming for style conformance. llvm-svn: 293543
* experimental: port directory_iterator to WindowsSaleem Abdulrasool2017-01-301-0/+72
| | | | | | | | | This adds a basic first cut implementation for directory_iterator on Windows. It uses the FindFirstFile/FindNextFile which has the same restrictions as opendir/readdir where there exists a TOCTOU race condition. llvm-svn: 293531
* experimental: add missing file headerSaleem Abdulrasool2017-01-301-0/+9
| | | | | | | The directory_iterator implementation file was missing the file header. Add one. NFC. llvm-svn: 293530
* experimental: remove some extraneous _LIBCPP_FUNC_VISSaleem Abdulrasool2017-01-301-14/+13
| | | | | | | | | | These member functions were decorated with `_LIBCPP_FUNC_VIS` when the class is also decorated with external visibility. This breaks down when building for PE/COFF, where the member function cannot be decorated if it is within a decorated class. The class attribute will propagate to the member. Remove the extraneous decoration. llvm-svn: 293454
* experimental: inline single use of a typedefSaleem Abdulrasool2017-01-301-4/+1
| | | | | | | The typedef is not particularly long, and used in exactly one location. Just spell it out at the site. NFC. llvm-svn: 293450
* experimental: tolerate the existence of a `__deref` macroSaleem Abdulrasool2017-01-302-8/+11
| | | | | | | | Microsoft's SAL has a `__deref` macro which results in a compilation failure when building the filesystem module on Windows. Rename the member function internally to avoid the conflict. llvm-svn: 293449
* experimental: remove dead functionSaleem Abdulrasool2017-01-291-13/+0
| | | | | | | This template was defined inline, within the TU only and had no uses across the entire repository. Remove the dead code. NFC. llvm-svn: 293445
* config: prevent the re-definition of a macroSaleem Abdulrasool2017-01-291-0/+2
| | | | | | | | | This causes unnecessary warnings when building with `cl`. Newer versions of the C standard permit the redefinition of the macro to the same value (which is the case here), unfortunately, `cl` does not yet implement this. Add a check to prevent the redefinition. llvm-svn: 293439
* Disable thread safety analysis for some functions in __thread_supportDimitry Andric2017-01-261-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many thread-related libc++ test cases fail on FreeBSD, due to the following -Werror warnings: In file included from test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp:17: In file included from include/thread:97: In file included from include/__mutex_base:17: include/__threading_support:222:1: error: mutex '__m' is still held at the end of function [-Werror,-Wthread-safety-analysis] } ^ include/__threading_support:221:10: note: mutex acquired here return pthread_mutex_lock(__m); ^ include/__threading_support:231:10: error: releasing mutex '__m' that was not held [-Werror,-Wthread-safety-analysis] return pthread_mutex_unlock(__m); ^ include/__threading_support:242:1: error: mutex '__m' is still held at the end of function [-Werror,-Wthread-safety-analysis] } ^ include/__threading_support:241:10: note: mutex acquired here return pthread_mutex_lock(__m); ^ include/__threading_support:251:10: error: releasing mutex '__m' that was not held [-Werror,-Wthread-safety-analysis] return pthread_mutex_unlock(__m); ^ include/__threading_support:272:10: error: calling function 'pthread_cond_wait' requires holding mutex '__m' exclusively [-Werror,-Wthread-safety-analysis] return pthread_cond_wait(__cv, __m); ^ include/__threading_support:278:10: error: calling function 'pthread_cond_timedwait' requires holding mutex '__m' exclusively [-Werror,-Wthread-safety-analysis] return pthread_cond_timedwait(__cv, __m, __ts); ^ 6 errors generated. This is because on FreeBSD, the pthread functions have lock annotations. Since the functions in __thread_support are internal to libc++ only, add no_thread_safety_analysis attributes to suppress these warnings. Reviewers: mclow.lists, EricWF, delesley, aaron.ballman Reviewed By: aaron.ballman Subscribers: ed, aaron.ballman, joerg, emaste, cfe-commits Differential Revision: https://reviews.llvm.org/D28520 llvm-svn: 293197
OpenPOWER on IntegriCloud