2011-06-03 18:40:47 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
//
|
2019-01-19 10:56:40 +00:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2011-06-03 18:40:47 +00:00
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
2020-06-01 10:38:23 -04:00
|
|
|
// UNSUPPORTED: c++03
|
2016-04-28 22:28:23 +00:00
|
|
|
|
2011-06-03 18:40:47 +00:00
|
|
|
// <string>
|
|
|
|
|
|
|
|
|
|
// basic_string()
|
|
|
|
|
// noexcept(is_nothrow_default_constructible<allocator_type>::value);
|
|
|
|
|
|
|
|
|
|
// This tests a conforming extension
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <cassert>
|
|
|
|
|
|
2015-06-03 19:56:43 +00:00
|
|
|
#include "test_macros.h"
|
2013-12-03 00:18:10 +00:00
|
|
|
#include "test_allocator.h"
|
2011-06-03 18:40:47 +00:00
|
|
|
|
2019-02-04 20:31:13 +00:00
|
|
|
int main(int, char**)
|
2011-06-03 18:40:47 +00:00
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
typedef std::string C;
|
|
|
|
|
static_assert(std::is_nothrow_default_constructible<C>::value, "");
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
typedef std::basic_string<char, std::char_traits<char>, test_allocator<char>> C;
|
|
|
|
|
static_assert(std::is_nothrow_default_constructible<C>::value, "");
|
|
|
|
|
}
|
|
|
|
|
{
|
2018-07-02 18:41:15 +00:00
|
|
|
typedef std::basic_string<char, std::char_traits<char>, limited_allocator<char, 10>> C;
|
2011-06-03 18:40:47 +00:00
|
|
|
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
|
|
|
|
|
}
|
2019-02-04 20:31:13 +00:00
|
|
|
|
|
|
|
|
return 0;
|
2011-06-03 18:40:47 +00:00
|
|
|
}
|