GCC 4.9 seems to think that a constexpr default constructor implies the constructor to be noexcept. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348850 91177308-0d34-0410-b5e6-96231b3b80d8
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
//===----------------------------------------------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
// Source Licenses. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// UNSUPPORTED: c++98, c++03
|
|
|
|
// <utility>
|
|
|
|
// template <class T1, class T2> struct pair
|
|
|
|
// constexpr pair();
|
|
|
|
#include <utility>
|
|
#include <type_traits>
|
|
|
|
|
|
struct ThrowingDefault {
|
|
ThrowingDefault() { }
|
|
};
|
|
|
|
struct NonThrowingDefault {
|
|
NonThrowingDefault() noexcept { }
|
|
};
|
|
|
|
int main() {
|
|
|
|
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, "");
|
|
static_assert( std::is_nothrow_default_constructible<std::pair<NonThrowingDefault, NonThrowingDefault>>::value, "");
|
|
}
|