Implement the missing constexpr stuff in <array>. Fixes PR#31645.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292091 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2017-01-16 03:02:10 +00:00
parent 6948dbedca
commit d25c997c77
4 changed files with 62 additions and 8 deletions

View File

@@ -23,6 +23,14 @@
// Disable the missing braces warning for this reason.
#include "disable_missing_braces_warning.h"
#if TEST_STD_VER > 14
constexpr bool check_idx( size_t idx, double val )
{
std::array<double, 3> arr = {1, 2, 3.5};
return arr[idx] == val;
}
#endif
int main()
{
{
@@ -63,4 +71,11 @@ int main()
}
#endif
#if TEST_STD_VER > 14
{
static_assert (check_idx(0, 1), "");
static_assert (check_idx(1, 2), "");
static_assert (check_idx(2, 3.5), "");
}
#endif
}