diff options
author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-23 22:12:31 +0000 |
---|---|---|
committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-23 22:12:31 +0000 |
commit | 0a394876fc77a7a2f3a8dfcc3ffc03f9bfd08a4e (patch) | |
tree | d7290199dcf0835cffc3741866d690b219d1916a | |
parent | 5a72e1db611aed18c024561c1e6f0bd85585d8ee (diff) | |
download | gcc-0a394876fc77a7a2f3a8dfcc3ffc03f9bfd08a4e.tar.gz |
* include/experimental/any (any_v1): Rename namespace to
fundamentals_v1. Change string returned by bad_any_cast::what().
* include/experimental/optional (fundamentals_v1): Add namespace.
* include/experimental/string_view (fundamentals_v1): Likewise.
* testsuite/experimental/any/typedefs.cc: New.
* testsuite/experimental/optional/typedefs.cc: New.
* testsuite/experimental/string_view/typedefs.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211920 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libstdc++-v3/ChangeLog | 9 | ||||
-rw-r--r-- | libstdc++-v3/include/experimental/any | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/experimental/optional | 3 | ||||
-rw-r--r-- | libstdc++-v3/include/experimental/string_view | 3 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/experimental/any/typedefs.cc | 30 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/experimental/optional/typedefs.cc | 33 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/experimental/string_view/typedefs.cc | 36 |
7 files changed, 117 insertions, 3 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 9d344d1bcd5..d3c01f55d9a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -4,6 +4,7 @@ * include/std/chrono (_Checked_integral_constant): Allow zero. * testsuite/20_util/duration/literals/values.cc: Test non-positive values and digit separators. + * include/experimental/any PR libstdc++/61532 * testsuite/20_util/make_signed/requirements/typedefs-1.cc: Do not @@ -14,6 +15,14 @@ * testsuite/20_util/make_unsigned/requirements/typedefs-2.cc: Likewise. + * include/experimental/any (any_v1): Rename namespace to + fundamentals_v1. Change string returned by bad_any_cast::what(). + * include/experimental/optional (fundamentals_v1): Add namespace. + * include/experimental/string_view (fundamentals_v1): Likewise. + * testsuite/experimental/any/typedefs.cc: New. + * testsuite/experimental/optional/typedefs.cc: New. + * testsuite/experimental/string_view/typedefs.cc: New. + 2014-06-18 Paolo Carlini <paolo.carlini@oracle.com> Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> diff --git a/libstdc++-v3/include/experimental/any b/libstdc++-v3/include/experimental/any index 1e8d9b2f7d1..643fc235848 100644 --- a/libstdc++-v3/include/experimental/any +++ b/libstdc++-v3/include/experimental/any @@ -47,7 +47,7 @@ namespace std _GLIBCXX_VISIBILITY(default) { namespace experimental { -inline namespace any_v1 +inline namespace fundamentals_v1 { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -68,7 +68,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION class bad_any_cast : public bad_cast { public: - virtual const char* what() const noexcept { return "bad_any_cast"; } + virtual const char* what() const noexcept { return "bad any_cast"; } }; [[gnu::noreturn]] inline void __throw_bad_any_cast() @@ -604,7 +604,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // @} group any _GLIBCXX_END_NAMESPACE_VERSION -} // namespace any_v1 +} // namespace fundamentals_v1 } // namespace experimental } // namespace std diff --git a/libstdc++-v3/include/experimental/optional b/libstdc++-v3/include/experimental/optional index 2a3f29dcd70..c68d7ea3808 100644 --- a/libstdc++-v3/include/experimental/optional +++ b/libstdc++-v3/include/experimental/optional @@ -52,6 +52,8 @@ namespace std _GLIBCXX_VISIBILITY(default) { namespace experimental { +inline namespace fundamentals_v1 +{ _GLIBCXX_BEGIN_NAMESPACE_VERSION /** @@ -797,6 +799,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // @} group optional _GLIBCXX_END_NAMESPACE_VERSION +} // namespace fundamentals_v1 } // [X.Y.12] diff --git a/libstdc++-v3/include/experimental/string_view b/libstdc++-v3/include/experimental/string_view index b54c9e85db8..4b1a10789c3 100644 --- a/libstdc++-v3/include/experimental/string_view +++ b/libstdc++-v3/include/experimental/string_view @@ -46,6 +46,8 @@ namespace std _GLIBCXX_VISIBILITY(default) { namespace experimental { +inline namespace fundamentals_v1 +{ _GLIBCXX_BEGIN_NAMESPACE_VERSION /** @@ -582,6 +584,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif _GLIBCXX_END_NAMESPACE_VERSION +} // namespace fundamentals_v1 } // namespace experimental diff --git a/libstdc++-v3/testsuite/experimental/any/typedefs.cc b/libstdc++-v3/testsuite/experimental/any/typedefs.cc new file mode 100644 index 00000000000..a3f364d78f9 --- /dev/null +++ b/libstdc++-v3/testsuite/experimental/any/typedefs.cc @@ -0,0 +1,30 @@ +// { dg-options "-std=gnu++14" } +// { dg-do compile } + +// Copyright (C) 2014 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 moved_to of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <experimental/any> +#include <type_traits> +#include <typeinfo> + +using check1_t = std::experimental::fundamentals_v1::any; +using check2_t = std::experimental::fundamentals_v1::bad_any_cast; + +static_assert(std::is_base_of<std::bad_cast, check2_t>::value, + "bad_any_cast must derive from bad_cast"); + diff --git a/libstdc++-v3/testsuite/experimental/optional/typedefs.cc b/libstdc++-v3/testsuite/experimental/optional/typedefs.cc new file mode 100644 index 00000000000..2dee878c219 --- /dev/null +++ b/libstdc++-v3/testsuite/experimental/optional/typedefs.cc @@ -0,0 +1,33 @@ +// { dg-options "-std=gnu++14" } +// { dg-do compile } + +// Copyright (C) 2014 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 moved_to of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <experimental/optional> +#include <type_traits> +#include <stdexcept> + +template<typename T> + using check1_t = std::experimental::fundamentals_v1::optional<T>; + +using check2_t = std::experimental::fundamentals_v1::in_place_t; +using check3_t = std::experimental::fundamentals_v1::nullopt_t; +using check4_t = std::experimental::fundamentals_v1::bad_optional_access; + +static_assert(std::is_base_of<std::logic_error, check4_t>::value, + "bad_optional_access must derive from logic_error"); diff --git a/libstdc++-v3/testsuite/experimental/string_view/typedefs.cc b/libstdc++-v3/testsuite/experimental/string_view/typedefs.cc new file mode 100644 index 00000000000..f148a1729e6 --- /dev/null +++ b/libstdc++-v3/testsuite/experimental/string_view/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++14" } +// { dg-do compile } + +// Copyright (C) 2014 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 moved_to of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <experimental/string_view> + +template<typename C, typename T> + using check1_t = std::experimental::fundamentals_v1::basic_string_view<C, T>; + +using check2_t = std::experimental::fundamentals_v1::string_view; + +#ifdef _GLIBCXX_USE_C99_STDINT_TR1 +using check3_t = std::experimental::fundamentals_v1::u16string_view; +using check4_t = std::experimental::fundamentals_v1::u32string_view; +#endif + +#ifdef _GLIBCXX_USE_WCHAR_T +using check5_t = std::experimental::fundamentals_v1::wstring_view; +#endif + |