summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
* std::get<0>([std::variant constant expression]) *is* noexcept.Casey Carter2016-12-062-2/+40
| | | | | | Differential review: http://reviews.llvm.org/D27436 llvm-svn: 288760
* Fix C++03 modules buildEric Fiselier2016-12-061-0/+2
| | | | llvm-svn: 288755
* [libcxx] [test] D27269: Fix MSVC x64 warning C4267 "conversion from 'size_t' ↵Stephan T. Lavavej2016-12-067-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | to 'int' [or 'unsigned int'], possible loss of data", part 3/4. test/std/containers/sequences/vector.bool/copy.pass.cpp test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp test/std/containers/sequences/vector/vector.cons/copy.pass.cpp test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp Change "unsigned s = x.size();" to "typename C::size_type s = x.size();" because that's what it returns. test/std/strings/basic.string/string.cons/pointer_alloc.pass.cpp Include <cstddef>, then change "unsigned n = T::length(s);" to "std::size_t n = T::length(s);" because that's what char_traits returns. test/std/strings/basic.string/string.cons/substr.pass.cpp Change unsigned to typename S::size_type because that's what str.size() returns. test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp This was needlessly truncating std::size_t to unsigned. It's being used to compare and initialize std::size_t. llvm-svn: 288753
* [libcxx] [test] D27268: Fix MSVC x64 warning C4267 "conversion from 'size_t' ↵Stephan T. Lavavej2016-12-063-17/+17
| | | | | | | | | | | | | to 'int' [or 'unsigned int'], possible loss of data", part 2/4. Use static_cast<int> when storing size_t in int (or passing size_t to int). Also, remove a spurious semicolon in test/support/archetypes.hpp. test/support/count_new.hpp Additionally, change data members (and parameters) to size_t. llvm-svn: 288752
* [libcxx] [test] D27267: Fix MSVC x64 warning C4267 "conversion from 'size_t' ↵Stephan T. Lavavej2016-12-0635-35/+35
| | | | | | | | | | | | to 'int' [or 'unsigned int'], possible loss of data", part 1/4. Replace "int n = str_.size();" with "int n = static_cast<int>(str_.size());". int is the correct type to use, because we're eventually calling "base::pbump(n+1);" where base is std::basic_streambuf. N4606 27.6.3.3.3 [streambuf.put.area]/4 declares: "void pbump(int n);" llvm-svn: 288751
* [libcxx] [test] D27266: Remove spurious semicolons.Stephan T. Lavavej2016-12-0613-27/+27
| | | | llvm-svn: 288750
* [libcxx] [test] D27025: Fix MSVC warning C4389 "signed/unsigned mismatch", ↵Stephan T. Lavavej2016-12-065-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | part 12/12. Various changes: test/std/algorithms/alg.sorting/alg.merge/inplace_merge.pass.cpp This is comparing value_type to unsigned. value_type is sometimes int and sometimes struct S (implicitly constructible from int). static_cast<value_type>(unsigned) silences the warning and doesn't do anything bad (as the values in question are small). test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp This is comparing an int remote-element to size_t. The values in question are small and non-negative, so either type is fine. I think that converting int to size_t is marginally better here than the reverse. test/std/containers/sequences/deque/deque.cons/size.pass.cpp DefaultOnly::count is int (and non-negative). When comparing to unsigned, use static_cast<unsigned>. test/std/strings/basic.string/string.access/index.pass.cpp We're comparing char to '0' through '9', but formed with the type size_t. Add static_cast<char>. test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp Include <cstddef> for pedantic correctness (this test was already mentioning std::size_t). "v[i] == (i & 1)" was comparing bool to size_t. Saying "v[i] == ((i & 1) != 0)" smashes the RHS to bool. llvm-svn: 288749
* [libcxx] [test] D27024: Fix MSVC warning C4389 "signed/unsigned mismatch", ↵Stephan T. Lavavej2016-12-067-17/+17
| | | | | | | | | | | | part 11/12. Change "unsigned n = 0;" to "int n = 0;". It's being compared to int elements and ptrdiff_t distances. test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp This one's a little special, but not really. "*i == n" is comparing MoveOnly to n. MoveOnly is implicitly constructible from int, so int is the correct type to use here. llvm-svn: 288748
* [libcxx] [test] D27023: Fix MSVC warning C4389 "signed/unsigned mismatch", ↵Stephan T. Lavavej2016-12-066-15/+15
| | | | | | | | | | | | part 10/12. Add static_cast<int>. In these cases, the values are guaranteed to be small-ish, and they're being compared to int elements. test/std/containers/sequences/deque/deque.capacity/access.pass.cpp Use int instead of unsigned to iterate from 0 to 10. llvm-svn: 288747
* [libcxx] [test] D27022: Fix MSVC warning C4389 "signed/unsigned mismatch", ↵Stephan T. Lavavej2016-12-0623-49/+69
| | | | | | | | | | part 9/12. Add static_cast<std::size_t> to more comparisons. (Performed manually, unlike part 8/12.) Also, include <cstddef> when it wasn't already being included. llvm-svn: 288746
* [libcxx] [test] D27021: Fix MSVC warning C4389 "signed/unsigned mismatch", ↵Stephan T. Lavavej2016-12-06117-943/+1046
| | | | | | | | | | | | | | | | | | | | | part 8/12. Add static_cast<std::size_t> when comparing distance() to size(). These replacements were performed programmatically with regex_replace(): const vector<pair<regex, string>> reg_fmt = { { regex(R"(assert\((\w+)\.size\(\) == std::distance\((\w+, \w+)\)\))"), "assert($1.size() == static_cast<std::size_t>(std::distance($2)))" }, { regex(R"(assert\(distance\((\w+\.begin\(\), \w+\.end\(\))\) == (\w+)\.size\(\)\))"), "assert(static_cast<std::size_t>(distance($1)) == $2.size())" }, { regex(R"(assert\(std::distance\((\w+\.\w*begin\(\), \w+\.\w*end\(\))\) == (\w+)\.size\(\)\))"), "assert(static_cast<std::size_t>(std::distance($1)) == $2.size())" }, }; Also, include <cstddef> when it wasn't already being included. llvm-svn: 288745
* Add support for writing -verify shell testsEric Fiselier2016-12-063-14/+45
| | | | llvm-svn: 288743
* Allow enabling/disabling testing with module using env LIBCXX_USE_MODULES=1Eric Fiselier2016-12-061-1/+4
| | | | | | | | | | The Clang modules implementation breaks enough that libc++ needs an easy way to enable/disable using modules on the Zorg builders. Editing Zorg itself requires a buildmaster restart which only happens weekly. This patch allows LIBCXX_USE_MODULES to be used to enable/disable the feature, allowing the buildslave to disable it as need be. llvm-svn: 288736
* Add module definitions for <experimental/foo> headersEric Fiselier2016-12-051-0/+116
| | | | llvm-svn: 288735
* Add module definitions for string_viewEric Fiselier2016-12-052-0/+12
| | | | llvm-svn: 288733
* Add modules for any/optional/variantEric Fiselier2016-12-051-0/+12
| | | | llvm-svn: 288730
* Adjust libc++ test infastructure to fully support modulesEric Fiselier2016-12-0537-140/+207
| | | | | | | | | | | | This patch overhalls the libc++ test format/configuration in order to fully support modules. By "fully support" I mean get almost all of the tests passing. The main hurdle for doing this is handling tests that `#define _LIBCPP_FOO` macros to test a different configuration. This patch deals with these tests in the following ways: 1. For tests that define single `_LIBCPP_ABI_FOO` macros have been annotated with `// MODULES_DEFINES: _LIBCPP_ABI_FOO`. This allows the test suite to define the macro on the command line so it uses a different set of modules. 2. Tests for libc++'s debug mode (which define custom `_LIBCPP_ASSERT`) are automatically detected by the test suite and are compiled and run with modules disabled. This patch also cleans up how the `CXXCompiler` helper class handles enabling/disabling language features. NOTE: This patch uses `LIT` features which were only committed to LLVM today. If this patch breaks running the libc++ tests you probably need to update LLVM. llvm-svn: 288728
* [libc++] Add _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONSShoaib Meenai2016-12-054-9/+43
| | | | | | | | | | | It's useful to be able to disable visibility annotations entirely; for example, if we're building libc++ static to include in another library, and we don't want any libc++ functions getting exported out of that library. This is a generalization of _LIBCPP_DISABLE_DLL_IMPORT_EXPORT. Differential Revision: https://reviews.llvm.org/D26934 llvm-svn: 288690
* Handle tests for noexcept that expect a false valueRoger Ferrer Ibanez2016-12-051-8/+16
| | | | | | | | | | Under libcpp-no-exceptions, noexcept is trivially true. Some tests expect in the usual setting to return false, so adjust them to expect true under libcpp-no-exceptions. Differential Revision: https://reviews.llvm.org/D27310 llvm-svn: 288660
* Update status page for variant implementationEric Fiselier2016-12-041-1/+1
| | | | llvm-svn: 288625
* Choose better hash values for std::monostate and valueless variants.Eric Fiselier2016-12-041-2/+4
| | | | | | | | | | | Previously these hashes were 0 and -1 respectively. These seem like common sentinel values and should be avoided to prevent needless collisions. This patch changes those values to different arbitrary numbers, which should hopefully cause less collisions. Because I couldn't help myself I choose the fundamental constants for gravity and the speed of light. llvm-svn: 288623
* Turn off testsuite warnings by default with GCCEric Fiselier2016-12-031-2/+3
| | | | llvm-svn: 288576
* Make make_exception_ptr abort with -fno-exceptionsEric Fiselier2016-12-031-1/+4
| | | | llvm-svn: 288575
* Mark various <variant> items as completeEric Fiselier2016-12-031-5/+5
| | | | llvm-svn: 288574
* Work around more -Wshadow warningsEric Fiselier2016-12-032-2/+2
| | | | llvm-svn: 288573
* Fix <variant> w/o exception supportEric Fiselier2016-12-031-2/+12
| | | | llvm-svn: 288571
* Revert workaround for Clang bug. Thanks to Richard for the quick fixEric Fiselier2016-12-031-5/+1
| | | | llvm-svn: 288566
* Fix -Wshadow warnings and enable warnings by default for C++ >= 11Eric Fiselier2016-12-032-3/+8
| | | | llvm-svn: 288564
* XFAIL variant tests for apple-clangEric Fiselier2016-12-034-4/+5
| | | | llvm-svn: 288559
* Enable warnings by default for C++ >= 11 and fix -Wshadow occurancesEric Fiselier2016-12-0310-45/+42
| | | | llvm-svn: 288557
* Work around Clang 3.8 bugsEric Fiselier2016-12-036-47/+62
| | | | llvm-svn: 288556
* Fix C++03 buildEric Fiselier2016-12-022-2/+2
| | | | llvm-svn: 288555
* Make variant's index part of the hash valueEric Fiselier2016-12-024-10/+31
| | | | llvm-svn: 288554
* Fix generated warnings in <variant>Eric Fiselier2016-12-021-4/+5
| | | | llvm-svn: 288552
* Update darwin ABI list for <variant>Eric Fiselier2016-12-021-0/+4
| | | | llvm-svn: 288551
* Update ABI lists for <variant>Eric Fiselier2016-12-022-1/+13
| | | | llvm-svn: 288550
* Implement C++17 <variant>. Patch from Michael Park!Eric Fiselier2016-12-0230-164/+2374
| | | | | | This patch was reviewed as https://reviews.llvm.org/D23263. llvm-svn: 288547
* Work around a bug in Clang's implementation of noexcept function typesEric Fiselier2016-12-021-1/+5
| | | | llvm-svn: 288544
* Fix copy/paste errors in new variant testsEric Fiselier2016-12-022-6/+6
| | | | llvm-svn: 288538
* Add tests for libc++'s constexpr variant copy/move extensionEric Fiselier2016-12-024-0/+93
| | | | llvm-svn: 288536
* Protect sequences test under libcpp-no-exceptionsRoger Ferrer Ibanez2016-12-012-7/+11
| | | | | | | | Replace throw with TEST_THROW and protect tests that do throw. Also add missing assert(false). Differential Revision: https://reviews.llvm.org/D27252 llvm-svn: 288383
* Protect futures test under libcpp-no-exceptionsRoger Ferrer Ibanez2016-12-011-1/+7
| | | | | | | | Skip tests that expect an exception be thrown. Differential Revision: https://reviews.llvm.org/D27253 llvm-svn: 288382
* Protect optional test under libcpp-no-exceptionsRoger Ferrer Ibanez2016-12-011-3/+6
| | | | | | | | Replace throw with TEST_THROW and skip tests that throw exceptions Differential Revision: https://reviews.llvm.org/D27254 llvm-svn: 288379
* Protect std::ostream::sentry test under libcpp-no-exceptionsRoger Ferrer Ibanez2016-12-011-1/+4
| | | | | | | | Skip test that throws an exception. Differential Revision: https://reviews.llvm.org/D27255 llvm-svn: 288378
* Protect std::array tests under noexceptionsRoger Ferrer Ibanez2016-11-291-3/+14
| | | | | | | | Skip tests that expect exceptions be thrown. Also add missing asserts. Differential Revision: https://reviews.llvm.org/D27095 llvm-svn: 288165
* Protect std::string tests under libcpp-no-exceptionsRoger Ferrer Ibanez2016-11-292-5/+19
| | | | | | | | | Skip tests that expect an exception be thrown and/or disable unreachable catch handlers. Differential Revision: https://reviews.llvm.org/D26612 llvm-svn: 288158
* Protect std::{,unordered_}map tests under noexceptionsRoger Ferrer Ibanez2016-11-292-2/+18
| | | | | | | | Skip tests that use exceptions Differential Revision: https://reviews.llvm.org/D27093 llvm-svn: 288157
* Protect locale tests under noexceptionsRoger Ferrer Ibanez2016-11-294-4/+16
| | | | | | | | Skip tests that expect exceptions be thrown. Differential Revision: https://reviews.llvm.org/D27096 llvm-svn: 288156
* Protect test for dynarray under libcpp-no-exceptionsRoger Ferrer Ibanez2016-11-291-1/+6
| | | | | | | | This test expects an exception be thrown. Differential Revision: https://reviews.llvm.org/D26611 llvm-svn: 288155
* [libcxx] remove unused codeAditya Kumar2016-11-291-70/+2
| | | | | | | | | The macro _LIBCPP_UNROLL_LOOPS isn't used anywhere so the code was dead. Differential Revision: https://reviews.llvm.org/D26991 llvm-svn: 288143
OpenPOWER on IntegriCloud