[libcxx] Fix test failure on GCC 4.9

GCC 4.9 seems to think that a constexpr default constructor implies
the constructor to be noexcept.

llvm-svn: 348850
This commit is contained in:
Louis Dionne 2018-12-11 15:27:10 +00:00
parent d1e3fe2190
commit 17b65c0d58
1 changed files with 8 additions and 3 deletions

View File

@ -18,12 +18,17 @@
#include <utility>
#include <type_traits>
#include "archetypes.hpp"
struct ThrowingDefault {
ThrowingDefault() { }
};
struct NonThrowingDefault {
NonThrowingDefault() noexcept { }
};
int main() {
using NonThrowingDefault = NonThrowingTypes::DefaultOnly;
using ThrowingDefault = NonTrivialTypes::DefaultOnly;
static_assert(!std::is_nothrow_default_constructible<std::pair<ThrowingDefault, ThrowingDefault>>::value, "");
static_assert(!std::is_nothrow_default_constructible<std::pair<NonThrowingDefault, ThrowingDefault>>::value, "");
static_assert(!std::is_nothrow_default_constructible<std::pair<ThrowingDefault, NonThrowingDefault>>::value, "");