All constant expressions are non-potentially-throwing in C++14, but that is *not* the case in C++17. Change these tests of the `variant`-flavored overloads of `std::get` to expect the correct behavior when the compiler is not GCC or is GCC 9+.
Credit to Jonathan Wakely for providing an improved version of my initial change that validates the incorrect behavior on GCC < 9 as well as validating the correct behavior on other compilers.
Differential Revision: https://reviews.llvm.org/D61033
llvm-svn: 359220
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
Was VSO#109062. This bug was filed *4 years ago*. I submitted a workaround to enable the scoped_allocator_adaptor tests to pass. Bug fixed a week and a half later. This was either a waste of my time, or I've discovered that libc++ has magical bugfix-inducing powers. My money's on the latter.
llvm-svn: 304730
VSO#391542 "Types can't be convertible to nullptr_t"
Also put internal bug numbers on the workarounds in test_workarounds.h for correlation.
Differential Revision: https://reviews.llvm.org/D33290
llvm-svn: 303889
This change works around a couple of bugs:
1. EDG doesn't like explicit constexpr in a derived class. This program:
struct Base {};
struct Derived : Base {
constexpr Derived() = default;
};
triggers "error: defaulted default constructor cannot be constexpr."
2. C1XX with /Za has no idea which constructor needs to be valid for copy elision.
The change also conditionally disables parts of the msvc_stdlib_force_include.hpp header that conflict with external configuration when _LIBCXX_IN_DEVCRT is defined.
Differential Revision: https://reviews.llvm.org/D32778
llvm-svn: 302707
This patch overhauls both specializations of unique_ptr while implementing
the following LWG issues:
* LWG 2801 - This issue constrains unique_ptr's constructors when the deleter type
is not default constructible. Additionally it adds SFINAE conditions
to unique_ptr<T[]>::unique_ptr(Up).
* LWG 2905 - This issue reworks the unique_ptr(pointer, /* see below */ deleter)
constructors so that they correctly SFINAE when the deleter argument cannot
be used to construct the stored deleter.
* LWG 2520 - This issue fixes initializing unique_ptr<T[]> from nullptr.
Libc++ had previously implemented this issue, but the suggested resolution
still broke initialization from NULL. This patch re-works the
unique_ptr<T[]>(Up, deleter) overloads so that they accept NULL as well
as nullptr.
llvm-svn: 300406
This patch almost entirely rewrites the unique_ptr tests. There are a couple
of reasons for this:
A) Most of the *.fail.cpp tests were either incorrect or could be better written
as a *.pass.cpp test that uses <type_traits> to check if certain operations
are valid (Ex. Using static_assert(!std::is_copy_constructible_v<T>) instead
of writing a failure test).
B) [unique.ptr.runtime] has very poor test coverage. Many of the constructors
and assignment operators have to tests at all. The special members that have
tests have very few test cases and are typically way out of date.
C) The tests for [unique.ptr.single] and [unique.ptr.runtime] are largely
duplicates of each other. This means common requirements have two different
sets of tests in two different test files. This makes the tests harder to
maintain than if there was a single copy.
To address (A) this patch changes almost all of the *.fail.cpp tests into
.pass.cpp tests using type traits; Allowing the *.fail.cpp tests to be removed.
The address (B) and (C) the tests for [unique.ptr.single] and [unique.ptr.runtime]
have been combined into a single directory, allowing both specializations to share
common tests. Tests specific to the single/runtime specializations are given the
suffix "*.single.pass.cpp" or "*.runtime.pass.cpp".
Finally the unique.ptr test have been moved into the correct directory according
to the standard. Specifically they have been removed from "utilities/memory" into
"utilities/smartptr".
PS. This patch also adds newly written tests for upcoming unique_ptr changes/fixes.
However since these tests don't currently pass they are guarded by the macro
TEST_WORKAROUND_UPCOMING_UNIQUE_PTR_CHANGES. This allows other STL's to validate
the tests before libc++ implements the changes. The relevant libc++ changes should
land in the next week.
llvm-svn: 300388
Summary: This is my attempt to work around the C1XX bug described to me by @BillyONeal.
Reviewers: BillyONeal, STL_MSFT, CaseyCarter
Reviewed By: BillyONeal
Subscribers: cfe-commits, BillyONeal
Differential Revision: https://reviews.llvm.org/D31260
llvm-svn: 298554