diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2015-01-16 23:38:35 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2015-01-16 23:38:35 +0000 |
commit | 28af1fb39dfbf903ccafeafda927d280fd8768d8 (patch) | |
tree | 8c798f7195e89e40829e60d3b8f2b3e02730a5ea /libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/requirements | |
parent | 0f59f5c12003e547e7557cc09da39c2abd63403d (diff) | |
download | gcc-28af1fb39dfbf903ccafeafda927d280fd8768d8.tar.gz |
Implement C++11 <codecvt> header.
* config/abi/pre/gnu.ver: Export new symbols.
* include/Makefile.am: Add codecvt.
* include/Makefile.in: Regenerate.
* include/std/codecvt: New header.
* src/c++11/codecvt.cc (__codecvt_utf8_base, __codecvt_utf16_base,
__codecvt_utf8_utf16_base): Define specializations.
* testsuite/22_locale/codecvt/codecvt_utf8/requirements/1.cc: New.
* testsuite/22_locale/codecvt/codecvt_utf16/requirements/1.cc: New.
* testsuite/22_locale/codecvt/codecvt_utf8_utf16/requirements/1.cc:
New.
From-SVN: r219779
Diffstat (limited to 'libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/requirements')
-rw-r--r-- | libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/requirements/1.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/requirements/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/requirements/1.cc new file mode 100644 index 00000000000..5e5f8dd9fee --- /dev/null +++ b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/requirements/1.cc @@ -0,0 +1,37 @@ +// Copyright (C) 2015 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// { dg-require-cstdint "" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +#include <codecvt> +#include <type_traits> +#include <testsuite_hooks.h> + +template<typename C> + using codecvt = std::codecvt<C, char, std::mbstate_t>; + +using std::is_base_of; + +static_assert( + is_base_of<codecvt<char16_t>, std::codecvt_utf8_utf16<char16_t>>::value, + "codecvt_utf8_utf16<char16_t> has wrong base class"); + +static_assert( + is_base_of<codecvt<char32_t>, std::codecvt_utf8_utf16<char32_t>>::value, + "codecvt_utf8_utf16<char32_t> has wrong base class"); |