summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/meta
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix failing test due to incorrect use of noexceptEric Fiselier2018-05-111-14/+0
| | | | llvm-svn: 332066
* Fix PR37407 - callable traits don't correctly check complete types.Eric Fiselier2018-05-102-1/+37
| | | | | | | | | | | | | Checking for complete types is really rather tricky when you consider the amount of specializations required to check a function type. This specifically caused PR37407 where we incorrectly diagnosed noexcept function types as incomplete (but there were plenty of other cases that would cause this). This patch removes the complete type checking for now. I'm going to look into adding a clang builtin to correctly do this for us. llvm-svn: 332040
* [libcxx] [test] Fix whitespace, NFC.Stephan T. Lavavej2018-04-121-1/+1
| | | | | | test/std almost always uses spaces; now it is entirely tab-free. llvm-svn: 329978
* [test] [NFC] cleanup aligned_storage testCasey Carter2018-04-091-106/+55
| | | | | | | * `s/"" )/"")/g` * Don't redundantly test triviality for `TEST_STD_VER > 17` llvm-svn: 329618
* Implement LWG3034: P0767R1 breaks previously-standard-layout typesMarshall Clow2018-03-212-0/+66
| | | | llvm-svn: 328064
* Implement P0767R1 - Deprecate PODMarshall Clow2018-03-061-0/+102
| | | | llvm-svn: 326801
* [libcxx] [test] Strip trailing whitespace, NFC.Stephan T. Lavavej2018-02-121-2/+2
| | | | llvm-svn: 324959
* Fix has_unique_object_representation after Clang commit r324134.Eric Fiselier2018-02-021-2/+4
| | | | | | | | | Clang previously reported an empty union as having a unique object representation. This was incorrect and was fixed in a recent Clang commit. This patch fixes the libc++ tests. llvm-svn: 324153
* include <cstdint> to get uint32_tMarshall Clow2018-01-241-0/+1
| | | | llvm-svn: 323306
* Implement P0463R1: 'Endian just Endian'. Reviewed as ↵Marshall Clow2018-01-241-0/+47
| | | | | | https://reviews.llvm.org/D35472 llvm-svn: 323296
* Add pre-C++11 is_constructible wrappers for 3 argumentsDimitry Andric2018-01-071-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: After rL319736 for D28253 (which fixes PR28929), gcc cannot compile `<memory>` anymore in pre-C+11 modes, complaining: ``` In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory: In static member function 'static std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::make_shared(_A0&, _A1&, _A2&)': /usr/include/c++/v1/memory:4365:5: error: wrong number of template arguments (4, should be at least 1) static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" ); ^ In file included from /usr/include/c++/v1/memory:649:0, from test.cpp:1: /usr/include/c++/v1/type_traits:3198:29: note: provided for 'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible' struct _LIBCPP_TEMPLATE_VIS is_constructible ^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory:4365:5: error: template argument 1 is invalid static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" ); ^ /usr/include/c++/v1/memory: In static member function 'static std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::allocate_shared(const _Alloc&, _A0&, _A1&, _A2&)': /usr/include/c++/v1/memory:4444:5: error: wrong number of template arguments (4, should be at least 1) static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" ); ^ In file included from /usr/include/c++/v1/memory:649:0, from test.cpp:1: /usr/include/c++/v1/type_traits:3198:29: note: provided for 'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible' struct _LIBCPP_TEMPLATE_VIS is_constructible ^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/v1/memory:648:0, from test.cpp:1: /usr/include/c++/v1/memory:4444:5: error: template argument 1 is invalid static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" ); ^ ``` This is also reported in https://bugs.freebsd.org/224946 (FreeBSD is apparently one of the very few projects that regularly builds programs against libc++ with gcc). The reason is that the static assertions are invoking `is_constructible` with three arguments, while gcc does not have the built-in `is_constructible` feature, and the pre-C++11 `is_constructible` wrappers in `<type_traits>` only provide up to two arguments. I have added additional wrappers for three arguments, modified the `is_constructible` entry point to take three arguments instead, and added a simple test to is_constructible.pass.cpp. Reviewers: EricWF, mclow.lists Reviewed By: EricWF Subscribers: krytarowski, cfe-commits, emaste Differential Revision: https://reviews.llvm.org/D41805 llvm-svn: 321963
* Implement p0258r2: has_unique_object_representationsMarshall Clow2018-01-031-0/+104
| | | | llvm-svn: 321685
* [libcxx] P0604, invoke_result and is_invocableZhihao Yuan2017-12-126-281/+339
| | | | | | | | | | | | | | | | | | | | Summary: Introduce a new form of `result_of` without function type encoding. Rename and split `is_callable/is_nothrow_callable` into `is_invocable/is_nothrow_invocable/is_invocable_r/is_nothrow_invocable_r` (and associated types accordingly) Change function type encoding of previous `is_callable/is_nothrow_callable` traits to conventional template type parameter lists. Reviewers: EricWF, mclow.lists, bebuch Reviewed By: EricWF, bebuch Subscribers: lichray, bebuch, cfe-commits Differential Revision: https://reviews.llvm.org/D38831 llvm-svn: 320509
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2017-12-071-1/+1
| | | | llvm-svn: 319994
* Implement P0550R2: Transformation Trait remove_cvrefMarshall Clow2017-11-131-0/+52
| | | | llvm-svn: 318011
* Add a fail test for aligned_union of an incomplete type. See LWG#2979. NFCMarshall Clow2017-10-311-0/+23
| | | | llvm-svn: 316969
* [libcxx] [test] Untabify, NFC.Stephan T. Lavavej2017-07-295-16/+16
| | | | llvm-svn: 309464
* Cleanup test issues reported by STL @ Microsoft.Eric Fiselier2017-05-121-1/+3
| | | | | | | | | | | This patch cleans up a number of issues reported by STL, including: 1) Fix duplicate is_convertible test. 2) Move non-standard reference_wrapper tests under test/libcxx 3) Fix assumption that sizeof(wchar_t) == 32 in the codecvt and wstring_convert tests. llvm-svn: 302870
* XFAIL is_trivially_copyable test for compilers that don't implement Core 2094Eric Fiselier2017-05-101-1/+3
| | | | llvm-svn: 302723
* Update is_trivially_copyable tests with CWG 2094Billy Robert O'Neal III2017-05-101-4/+4
| | | | | | | | | Clang 5.0 implements these changes here: https://github.com/llvm-mirror/clang/commit/87cd035326a39523eeb1b295ad36cff337141ef9 MSVC++ will implement these changes in the first toolset update to 2017. Differential Revision: https://reviews.llvm.org/D33021 llvm-svn: 302710
* Fix two test failures caused by Windows mangling of function types.Eric Fiselier2017-05-072-15/+21
| | | | | | | | | | | | On Windows the function template `template <class T> void test()` has the same mangled name when instantiated with the distinct types `void()` and `void() noexcept`. When this occurs Clang emits an error. This error was causing two type-traits tests to fail. However this can be worked around by using class templates instead of function templates, which is what this patch does to fix the errors. llvm-svn: 302380
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the utilities libraryEric Fiselier2017-04-192-5/+5
| | | | llvm-svn: 300635
* [libc++] Implement LWG 2911 - add an is_aggregate type-traitEric Fiselier2017-04-121-0/+79
| | | | | | | | | | | | | | | | | Summary: This patch implements http://cplusplus.github.io/LWG/lwg-defects.html#2911. I'm putting this up for review until __is_aggregate is added to clang (See D31513) Reviewers: mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31515 llvm-svn: 300126
* [libcxx] [test] Avoid Clang's -Wunused-const-variable in ↵Stephan T. Lavavej2017-04-121-0/+1
| | | | | | | | | | is_constructible.pass.cpp. This happens when using Clang with MSVC's STL, so there are no actual uses of this variable. Fixes D31966. llvm-svn: 300079
* Fix a C++03 failureMarshall Clow2017-04-111-3/+3
| | | | llvm-svn: 299909
* Remove some trigraphs that GCC was complaining aboutMarshall Clow2017-04-111-2/+2
| | | | llvm-svn: 299907
* Fix PR#32605: common_type<T> is not SFINAE-friendlyMarshall Clow2017-04-101-1/+5
| | | | llvm-svn: 299901
* Fix PR#32606: std::decay mishandles abominable function typesMarshall Clow2017-04-101-0/+6
| | | | llvm-svn: 299894
* Implement P0548: 'common_type and duration' This involves a subtle change in ↵Marshall Clow2017-03-211-0/+21
| | | | | | the return type of the unary +/- operators for std::chrono::duration, though I expect that no one will notice. llvm-svn: 298416
* Fix PR32097 - is_abstract doesn't work on class templates.Eric Fiselier2017-03-011-0/+10
| | | | | | | | | | This patch fixes llvm.org/PR32097 by using the __is_abstract builtin type-trait instead of the previous library-only implementation. All supported compilers provide this trait. I've tested as far back as Clang 3.2, GCC 4.6 and MSVC trunk. llvm-svn: 296561
* Add tests for noexcept functionsEric Fiselier2017-02-133-93/+190
| | | | llvm-svn: 294995
* [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 -Wunused-local-typedef, part 3/3.Stephan T. Lavavej2017-02-051-2/+0
| | | | | | | | | | | | | | | | 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
* Fix bad XFAIL which recent LIT changes diagnosedEric Fiselier2017-01-241-1/+1
| | | | llvm-svn: 292905
* [libcxx] [test] Fix comment typos, strip trailing whitespace.Stephan T. Lavavej2017-01-181-1/+1
| | | | | | No functional change, no code review. llvm-svn: 292434
* [libcxx] [test] Don't ask whether Incomplete& can be assigned to.Stephan T. Lavavej2017-01-171-1/+0
| | | | | | | | | | | This is the subject of an active NB comment. Regardless of what the Working Paper currently says, asking this question is morally wrong, because the answer can change when the type is completed. C1XX now detects such precondition violations and complains about them; perhaps Clang should too. Fixes D28591. llvm-svn: 292281
* Implement P0435R1 - Resolving LWG issues for common_typeEric Fiselier2016-12-271-10/+183
| | | | llvm-svn: 290627
* Fix PR31481 - 3+ parameter common_type isn't SFINAE friendlyEric Fiselier2016-12-271-5/+17
| | | | llvm-svn: 290624
* Adjust libc++ test infastructure to fully support modulesEric Fiselier2016-12-051-0/+1
| | | | | | | | | | | | 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
* Revert workaround for Clang bug. Thanks to Richard for the quick fixEric Fiselier2016-12-031-5/+1
| | | | llvm-svn: 288566
* Work around a bug in Clang's implementation of noexcept function typesEric Fiselier2016-12-021-1/+5
| | | | llvm-svn: 288544
* [libcxx] [test] D27027: Strip trailing whitespace.Stephan T. Lavavej2016-11-231-2/+2
| | | | llvm-svn: 287829
* [libcxx] [test] Replace _LIBCPP_STD_VER with TEST_STD_VER.Stephan T. Lavavej2016-11-0417-25/+55
| | | | | | | | | | | This replaces every occurrence of _LIBCPP_STD_VER in the tests with TEST_STD_VER. Additionally, for every affected file, #include "test_macros.h" is being added explicitly if it wasn't already there. https://reviews.llvm.org/D26294 llvm-svn: 286007
* Fix __libcpp_is_constructible for source types with explicit conversion ↵Eric Fiselier2016-11-021-2/+118
| | | | | | | | | | | | | | | | | | | | | | operators. Previously __libcpp_is_constructible checked the validity of reference construction using 'eat<To>(declval<From>())' but this doesn't consider From's explicit conversion operators. This patch teaches __libcpp_is_constructible how to handle these cases. To do this we need to check the validity using 'static_cast<To>(declval<From>())'. Unfortunately static_cast allows additional base-to-derived and lvalue-to-rvalue conversions, which have to be checked for and manually rejected. While implementing these changes I discovered that Clang incorrectly rejects `static_cast<int&&>(declval<float&>())` even though `int &&X(declval<float&>())` is well formed. In order to tolerate this bug the `__eat<T>(...)` needs to be left in-place. Otherwise it could be replaced entirely with the new static_cast implementation. Thanks to Walter Brown for providing the test cases. llvm-svn: 285786
* Add void_t and invoke feature test macrosEric Fiselier2016-10-141-0/+36
| | | | llvm-svn: 284209
* Implement N4606 optionalEric Fiselier2016-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adapt implementation of Library Fundamentals TS optional into an implementation of N4606 optional. - Update relational operators per http://wg21.link/P0307 - Update to requirements of http://wg21.link/P0032 - Extension: Implement trivial copy/move construction/assignment for `optional<T>` when `T` is trivially copyable. Audit P/Rs for optional LWG issues: - 2756 "C++ WP optional<T> should 'forward' T's implicit conversions" Implemented, which also resolves 2753 "Optional's constructors and assignments need constraints" (modulo my refusal to explicitly delete the move operations, which is a design error that I'm working on correcting in the 2756 P/R). - 2736 "nullopt_t insufficiently constrained" Already conforming. I've added a test ensuring that `nullopt_t` is not copy-initializable from an empty braced-init-list, which I believe is the root intent of the issue, to avoid regression. - 2740 "constexpr optional<T>::operator->" Already conforming. - 2746 "Inconsistency between requirements for emplace between optional and variant" No P/R, but note that the author's '"suggested resolution" is already implemented. - 2748 "swappable traits for optionals" Already conforming. - 2753 "Optional's constructors and assignments need constraints" Implemented. Most of the work for this patch was done by Casey Carter @ Microsoft. Thank you Casey! Reviewers: mclow.lists, CaseyCarter, EricWF Differential Revision: https://reviews.llvm.org/D22741 llvm-svn: 283980
* Revert Add <optional>. Will recommit with better commit messageEric Fiselier2016-10-121-1/+1
| | | | llvm-svn: 283978
* Add <optional> header.Eric Fiselier2016-10-121-1/+1
| | | | | | | | This patch is largely thanks to Casey Carter @ Microsoft. He did the initial work of porting our experimental implementation and tests over to namespace std. llvm-svn: 283977
* Comment out failing test while I figure out who is at faultMarshall Clow2016-10-051-1/+1
| | | | llvm-svn: 283360
* Make tests for is_empty better. No functional change.Marshall Clow2016-10-051-5/+31
| | | | llvm-svn: 283339
OpenPOWER on IntegriCloud