summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/meta/meta.trans
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] Strip trailing whitespace from libc++Louis Dionne2019-10-231-1/+1
|
* P1152R4: Fix deprecation warnings in libc++ testsuite and in uses of ↵Richard Smith2019-10-191-0/+5
| | | | | | | | | | | | | | | | is_invocable that would internally conjure up a deprecated function type. Summary: The implementation of P1152R4 in Clang has resulted in some deprecation warnings appearing in the libc++ and libc++abi test suite. Fix or suppress these warnings. Reviewers: mclow.lists, EricWF Subscribers: christof, ldionne, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D68879 llvm-svn: 375307
* [libc++][test] Miscellaneous MSVC cleanupsCasey Carter2019-10-091-1/+3
| | | | | | | | | | | | * Silence unused-local-typedef warnings: `map.cons/assign_initializer_list.pass.cpp` (and the `set.cons` variant) uses a local typedef only within `LIBCPP_ASSERT`s, so clang diagnoses it as unused when testing non-libc++. * Add missing include: `c.math/abs.pass.cpp` uses `std::numeric_limits` but failed to `#include <limits>`. * Don't test non-type: A "recent" change to `meta.trans.other/underlying_type.pass.cpp` unconditionally tests the type `F` which is conditionally defined. * Use `hash<long long>` instead of `hash<short>` with `int` in `unordered_meow` deduction guide tests to avoid truncation warnings. * Convert `3.14` explicitly in `midpoint.float.pass` since MSVC incorrectly diagnoses `float meow = 3.14;` as truncating. Differential Revision: https://reviews.llvm.org/D68681 llvm-svn: 374248
* Implement P0340R3: Make 'underlying_type' SFINAE-friendly. Reviewed as ↵Marshall Clow2019-06-212-20/+106
| | | | | | https://reviews.llvm.org/D63574 llvm-svn: 364094
* Enable aligned_union in C++03Eric Fiselier2019-06-211-2/+0
| | | | llvm-svn: 364058
* Make rvalue metaprogramming traits work in C++03.Eric Fiselier2019-06-213-8/+0
| | | | | | The next step is to get move and forward working in C++03. llvm-svn: 364053
* Support overaligned types in `aligned_storage`.Eric Fiselier2019-04-301-0/+8
| | | | | | | | | | | | | | | | | Summary: The current implementation of aligned storage was written before we had `alignas`, so it used a list of builtin types to force the alignment. But this doesn't work overaligned requests. This patch adds a fallback case supporting over-alignment. It only affects case that were previously ill-formed. Reviewers: rsmith, ldionne, dlj, mclow.lists Reviewed By: mclow.lists Subscribers: mclow.lists, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D61301 llvm-svn: 359596
* Make common_type's implementation common Eric Fiselier2019-03-311-77/+98
| | | | | | | | | | | | | | | | | | | Summary: Currently the C++03 implementation of common_type has much different behavior than the C++11 one. This causes bugs, including inside `<chrono>`. This patch unifies the two implementations as best it can. The more code they share, the less their behavior can diverge. Reviewers: mclow.lists, ldionne, sbenza Reviewed By: mclow.lists, ldionne Subscribers: libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D59678 llvm-svn: 357370
* Reworked all the utilities/meta tests to use ASSERT_SAME_TYPE instead of ↵Marshall Clow2019-03-2825-101/+98
| | | | | | 'static_assert( is_same<'. Much easier to read. I left two tests alone: is_same.pass.cpp, which should call 'is_same' directly, and common_type.pass.cpp, which Eric is working on. NFC intended llvm-svn: 357146
* Support tests in freestandingJF Bastien2019-02-0430-30/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Freestanding is *weird*. The standard allows it to differ in a bunch of odd manners from regular C++, and the committee would like to improve that situation. I'd like to make libc++ behave better with what freestanding should be, so that it can be a tool we use in improving the standard. To do that we need to try stuff out, both with "freestanding the language mode" and "freestanding the library subset". Let's start with the super basic: run the libc++ tests in freestanding, using clang as the compiler, and see what works. The easiest hack to do this: In utils/libcxx/test/config.py add: self.cxx.compile_flags += ['-ffreestanding'] Run the tests and they all fail. Why? Because in freestanding `main` isn't special. This "not special" property has two effects: main doesn't get mangled, and main isn't allowed to omit its `return` statement. The first means main gets mangled and the linker can't create a valid executable for us to test. The second means we spew out warnings (ew) and the compiler doesn't insert the `return` we omitted, and main just falls of the end and does whatever undefined behavior (if you're luck, ud2 leading to non-zero return code). Let's start my work with the basics. This patch changes all libc++ tests to declare `main` as `int main(int, char**` so it mangles consistently (enabling us to declare another `extern "C"` main for freestanding which calls the mangled one), and adds `return 0;` to all places where it was missing. This touches 6124 files, and I apologize. The former was done with The Magic Of Sed. The later was done with a (not quite correct but decent) clang tool: https://gist.github.com/jfbastien/793819ff360baa845483dde81170feed This works for most tests, though I did have to adjust a few places when e.g. the test runs with `-x c`, macros are used for main (such as for the filesystem tests), etc. Once this is in we can create a freestanding bot which will prevent further regressions. After that, we can start the real work of supporting C++ freestanding fairly well in libc++. <rdar://problem/47754795> Reviewers: ldionne, mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, arphaman, miyuki, libcxx-commits Differential Revision: https://reviews.llvm.org/D57624 llvm-svn: 353086
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1930-120/+90
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`. Eric Fiselier2019-01-161-6/+3
| | | | | | | | | | | | | | | | | | | | | Summary: Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See llvm.org/PR39713 This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used. This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement. I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. Reviewers: ldionne, EricWF Reviewed By: ldionne, EricWF Subscribers: jyknight, christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D54814 llvm-svn: 351289
* Revert "Move internal usages of `alignof`/`__alignof` to use ↵Eric Fiselier2018-11-281-3/+6
| | | | | | | | | | | `_LIBCPP_ALIGNOF`. " This reverts commit 087f065cb0c7463f521a62599884493aaee2ea12. The tests were failing on 32 bit builds, and I don't have time to clean them up right now. I'll recommit tomorrow with fixed tests. llvm-svn: 347816
* Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`. Eric Fiselier2018-11-281-6/+3
| | | | | | | | | | | | | | | | | | | | | Summary: Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See llvm.org/PR39713 This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used. This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement. I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. Reviewers: ldionne, EricWF Reviewed By: EricWF Subscribers: christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D54814 llvm-svn: 347787
* Implement P0887: The identity metafunctionMarshall Clow2018-08-021-0/+40
| | | | llvm-svn: 338666
* [test] two small cleanups:Casey Carter2018-07-091-3/+2
| | | | | | | | * Remove unused type from is_assignable.pass.cpp * Don't specialize `common_type<::X<float>>` in common_type.pass.cpp, which violates the requirements of [meta.trans.other]/5 llvm-svn: 336618
* 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] P0604, invoke_result and is_invocableZhihao Yuan2017-12-122-6/+52
| | | | | | | | | | | | | | | | | | | | 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-291-4/+4
| | | | llvm-svn: 309464
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the utilities libraryEric Fiselier2017-04-191-2/+2
| | | | llvm-svn: 300635
* 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
* [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
* 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
* [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-0414-22/+46
| | | | | | | | | | | 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
* Remove all instances of _LIBCPP_HAS_NO_RVALUE_REFERENCES from test/std/utilitiesEric Fiselier2016-10-012-11/+4
| | | | llvm-svn: 283032
* Work around MSVC's non-standard ABI for enums. Patch from STL@microsoft.comEric Fiselier2016-07-253-5/+22
| | | | llvm-svn: 276589
* Replace __cplusplus comparisons and dialect __has_feature checks with ↵Eric Fiselier2016-06-142-3/+5
| | | | | | | | | TEST_STD_VER. This is a huge cleanup that helps make the libc++ test suite more portable. Patch from STL@microsoft.com. Thanks STL! llvm-svn: 272716
* Remove trailing whitespace in test suite. Approved by Marshall Clow.Eric Fiselier2016-06-011-1/+1
| | | | llvm-svn: 271435
* [libcxx] Improve tests to use the UNSUPPORTED lit directiveAsiri Rathnayake2016-05-281-4/+1
| | | | | | | | | | | | | | | | | | | Quite a few libcxx tests seem to follow the format: #if _LIBCPP_STD_VER > X // Do test. #else // Empty test. #endif We should instead use the UNSUPPORTED lit directive to exclude the test on earlier C++ standards. This gives us a more accurate number of test passes for those standards and avoids unnecessary conflicts with other lit directives on the same tests. Reviewers: bcraig, ericwf, mclow.lists Differential revision: http://reviews.llvm.org/D20730 llvm-svn: 271108
* Add 'is_callable' and 'is_nothrow_callable' traits and cleanup INVOKE.Eric Fiselier2016-04-202-0/+11
| | | | | | | | | | | | The primary purpose of this patch is to add the 'is_callable' traits. Since 'is_nothrow_callable' required making 'INVOKE' conditionally noexcept I also took this oppertunity to implement a constexpr version of INVOKE. This fixes 'std::experimental::apply' which required constexpr 'INVOKE support'. This patch will be followed up with some cleanup. Primarly removing most of "__member_function_traits" since it's no longer used by INVOKE (in C++11 at least). llvm-svn: 266836
* Implement LWG issue 2219 - support reference_wrapper in INVOKEEric Fiselier2016-04-182-10/+135
| | | | llvm-svn: 266590
* Implement LWG#2101 'Some transformation types can produce impossible types' ↵Marshall Clow2016-01-215-13/+114
| | | | | | Introduced a new (internal) type trait '__is_referenceable' with tests. Use that trait in add_lvalue_reference, add_rvalue_reference and add_pointer. llvm-svn: 258418
* K-Ballo pointed out a mistake in the add_lvalue_ref tests I checked in; now ↵Marshall Clow2015-12-141-7/+7
| | | | | | more of them are passing. Thanks llvm-svn: 255519
* Add add_lvalue_ref tests for a few function types, with a note why not moreMarshall Clow2015-12-141-0/+36
| | | | llvm-svn: 255513
* Walter pointed out some missing includes in the tests. Fixing the includes ↵Marshall Clow2015-11-101-21/+23
| | | | | | uncovered a couple bugs in the _v type traits. Fixed those, too llvm-svn: 252612
OpenPOWER on IntegriCloud