summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop
Commit message (Collapse)AuthorAgeFilesLines
* [libc++] Purge mentions of GCC 4 from the test suiteLouis Dionne2019-09-256-11/+1
| | | | | | | | | We don't support GCC 4 and older according to the documentation, so we should pretend it doesn't exist. This is a re-application of r372787. llvm-svn: 372916
* Revert r372777: [libc++] Implement LWG 2510 and its follow-upsIlya Biryukov2019-09-256-1/+11
| | | | | | | | | | | | This also reverts: - r372778: [libc++] Implement LWG 3158 - r372782: [libc++] Try fixing tests that fail on GCC 5 and older - r372787: Purge mentions of GCC 4 from the test suite Reason: the change breaks compilation of LLVM with libc++, for details see http://lists.llvm.org/pipermail/libcxx-dev/2019-September/000599.html llvm-svn: 372832
* [libc++] Purge mentions of GCC 4 from the test suiteLouis Dionne2019-09-246-11/+1
| | | | | | | We don't support GCC 4 and older according to the documentation, so we should pretend it doesn't exist. llvm-svn: 372787
* Fix various test failures with GCCEric Fiselier2019-09-131-2/+6
| | | | llvm-svn: 371880
* Use rvalue references throughout the is_constructible traits.Eric Fiselier2019-06-213-6/+3
| | | | llvm-svn: 364065
* Mark is_trivially_destructible as unsupported with apple-clang-9Nico Weber2019-05-031-0/+1
| | | | | | See discussion on https://reviews.llvm.org/D48292 llvm-svn: 359907
* Use modern type trait implementations when available.Richard Smith2019-04-251-0/+6
| | | | | | | | | | | | | | Teach libcxx to stop using various deprecated __has_* type traits, in favor of the ("modern", C++11 era) __is_* type traits. This is mostly just a simplification, but fixes at least one bug: _Atomic T should be considered trivially-destructible, but is not considered to be POD by Clang, and __has_trivial_destructor is specified in the GCC documentation as returning false for non-POD non-class types. Differential Revision: https://reviews.llvm.org/D48292 llvm-svn: 359159
* Support tests in freestandingJF Bastien2019-02-0445-45/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1945-180/+135
| | | | | | | | | | | | | | | | | | 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
* Add a test that shows what happens with throwing destructors. NFC.Marshall Clow2018-10-111-0/+11
| | | | llvm-svn: 344220
* [test] two small cleanups:Casey Carter2018-07-091-2/+0
| | | | | | | | * 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
* Update XFAIL so apple-clang-9.0 is the last version not implementing Core 2094.Volodymyr Sapsai2018-05-141-1/+1
| | | | | | The test is passing with apple-clang-9.1. rdar://problem/40222003 llvm-svn: 332282
* 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
* 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] [test] Untabify, NFC.Stephan T. Lavavej2017-07-292-2/+2
| | | | llvm-svn: 309464
* 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
* [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 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
* [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
* 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
* 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
* 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
* Add tests to make sure that is_constructible<cv-void> is false. We already ↵Marshall Clow2016-10-031-0/+3
| | | | | | checked 'unqualified void'. This was brought up by LWG#2738 llvm-svn: 283161
* Remove all instances of _LIBCPP_HAS_NO_RVALUE_REFERENCES from test/std/utilitiesEric Fiselier2016-10-015-11/+8
| | | | llvm-svn: 283032
* Make std::is_assignable tolerate references to incomplete types.Eric Fiselier2016-07-251-2/+5
| | | | llvm-svn: 276599
* Unbreak traits tests by handling differences between version macros in ↵Eric Fiselier2016-07-202-2/+4
| | | | | | clang/apple-clang. llvm-svn: 276200
* Unbreak is_constructible tests for Clang <= 3.7.Eric Fiselier2016-07-202-1/+25
| | | | | | | There is a bug in Clang's __is_constructible builtin that causes it to return true for function types; ex [T = void()]. llvm-svn: 276092
* Reimplement is_constructible fallback implementation. Fixes PR21574.Eric Fiselier2016-07-202-7/+60
| | | | | | | The previous implementation relied highly on specializations to handle special cases. This new implementation lets the compiler do the work when possible. llvm-svn: 276084
* Add tests for the meta.unary.props that do not require a complete type. This ↵Marshall Clow2016-07-124-0/+14
| | | | | | is part of LWG#2582 llvm-svn: 275184
* Allow is_swappable to SFINAE on deleted/ambiguous swap functionsEric Fiselier2016-07-111-0/+21
| | | | llvm-svn: 275094
* Fix typo in #ifdef; leave tests commented out b/c gcc 4.8 harks on them.Marshall Clow2016-07-081-2/+2
| | | | llvm-svn: 274882
* Revert r274605 due to bot failure: ↵Manman Ren2016-07-061-7/+7
| | | | | | http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/244/ llvm-svn: 274651
* Fix typo in #ifdef, and re-enable tests now that the green-dragon bots are ↵Marshall Clow2016-07-061-7/+7
| | | | | | no more llvm-svn: 274605
* Fix use of terse static assert. Patch from STL@microsoft.comEric Fiselier2016-06-301-1/+1
| | | | llvm-svn: 274206
* Fix comment typos, strip trailing whitespace. Patch from STL@microsoft.comEric Fiselier2016-06-223-3/+3
| | | | llvm-svn: 273357
* Avoid huge main() functions and huge arrays. Patch from STL@microsoft.comEric Fiselier2016-06-221-3/+3
| | | | llvm-svn: 273354
* Don't use C++17 terse static assert. Patch from STL@microsoft.comEric Fiselier2016-06-224-15/+15
| | | | llvm-svn: 273353
* Replace __cplusplus comparisons and dialect __has_feature checks with ↵Eric Fiselier2016-06-146-6/+8
| | | | | | | | | 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
* Fix warnings in tests.Eric Fiselier2016-06-144-2/+18
| | | | llvm-svn: 272629
* Remove trailing whitespace in test suite. Approved by Marshall Clow.Eric Fiselier2016-06-018-12/+12
| | | | llvm-svn: 271435
* [libcxx] Improve tests to use the UNSUPPORTED lit directiveAsiri Rathnayake2016-05-281-5/+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
* Fix or move various non-standard tests.Eric Fiselier2016-04-291-71/+0
| | | | | | | | | | | | This patch does the following: * Remove <__config> includes from some container tests. * Guards uses of std::launch::any in async tests because it's an extension. * Move "test/std/extensions" to "test/libcxx/extensions" * Moves various non-standard tests including those in "sequences/vector", "std/localization" and "utilities/meta". llvm-svn: 267981
OpenPOWER on IntegriCloud