History log of /external/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
16e2ba19dfffdcf9bba202eb8a27fd79e3d15303 18-Jan-2017 Stephan T. Lavavej <stl@exchange.microsoft.com> [libcxx] [test] Fix comment typos, strip trailing whitespace.

No functional change, no code review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp
da1818a08c9676000c464402f634cb0e9340389d 21-Feb-2015 Eric Fiselier <eric@efcs.ca> [libc++] Try and prevent evaluation of `is_default_constructible` on tuples default constructor if it is not needed.

Summary:
Currently parts of the SFINAE on tuples default constructor always gets evaluated even when the default constructor is never called or instantiated. This can cause a hard compile error when a tuple is created with types that do not have a default constructor. Below is a self contained example using a pair like class. This code will not compile but probably should.

```

#include <type_traits>

template <class T>
struct IllFormedDefaultImp {
IllFormedDefaultImp(T x) : value(x) {}
constexpr IllFormedDefaultImp() {}
T value;
};

typedef IllFormedDefaultImp<int &> IllFormedDefault;

template <class T, class U>
struct pair
{
template <bool Dummy = true,
class = typename std::enable_if<
std::is_default_constructible<T>::value
&& std::is_default_constructible<U>::value
&& Dummy>::type
>
constexpr pair() : first(), second() {}

pair(T const & t, U const & u) : first(t), second(u) {}

T first;
U second;
};

int main()
{
int x = 1;
IllFormedDefault v(x);
pair<IllFormedDefault, IllFormedDefault> p(v, v);
}
```

One way to fix this is to use `Dummy` in a more involved way in the constructor SFINAE. The following patch fixes these sorts of hard compile errors for tuple.


Reviewers: mclow.lists, rsmith, K-ballo, EricWF

Reviewed By: EricWF

Subscribers: ldionne, cfe-commits

Differential Revision: http://reviews.llvm.org/D7569

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp
f063052fe1d3c7a40de69795228a6334f956b9f9 19-Feb-2015 Eric Fiselier <eric@efcs.ca> [libcxx] Mark most tuple tests UNSUPPORTED for c++03 and c++98.

Summary: No declaration for the type `tuple` is given in c++03 or c++98 modes. Mark all tests that use the actual `tuple` type as UNSUPPORTED.

Reviewers: jroelofs, mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5956

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp
a90c6dd46005b2b14de3bb889a8d03bb34bd3256 20-Dec-2014 Eric Fiselier <eric@efcs.ca> Move test into test/std subdirectory.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp