From 706144c4ae398f4b3d35eb0cfde9650816c94e6c Mon Sep 17 00:00:00 2001 From: emsr Date: Tue, 11 Jun 2013 11:00:38 +0000 Subject: [PATCH] 2013-06-11 Ed Smith-Rowland <3dw4rd@verizon.net> Fix library literals error involving namespace __detail. * include/std/chrono: Rename __detail to __select_type. Reformat. * include/bits/basic_string.h: Reformat. * testsuite/20_util/duration/literals/ns_detail.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199948 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 7 +++++ libstdc++-v3/include/bits/basic_string.h | 6 ++-- libstdc++-v3/include/std/chrono | 35 ++++++++++++---------- .../20_util/duration/literals/ns_detail.cc | 7 +++++ 4 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 libstdc++-v3/testsuite/20_util/duration/literals/ns_detail.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 60bc7b5a5eb..bef2e0d1dd1 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2013-06-11 Ed Smith-Rowland <3dw4rd@verizon.net> + + Fix library literals error involving namespace __detail. + * include/std/chrono: Rename __detail to __select_type. Reformat. + * include/bits/basic_string.h: Reformat. + * testsuite/20_util/duration/literals/ns_detail.cc: New. + 2013-06-11 Paolo Carlini PR libstdc++/56019 diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index aec48d7430a..cbea5664e71 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -3105,8 +3105,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus > 201103L - inline namespace literals { - inline namespace string_literals { + inline namespace literals + { + inline namespace string_literals + { inline basic_string operator"" s(const char* __str, size_t __len) diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono index b32fb4460de..d5ef984279d 100644 --- a/libstdc++-v3/include/std/chrono +++ b/libstdc++-v3/include/std/chrono @@ -782,10 +782,13 @@ _GLIBCXX_END_NAMESPACE_VERSION #if __cplusplus > 201103L - inline namespace literals { - inline namespace chrono_literals { + inline namespace literals + { + inline namespace chrono_literals + { - namespace __detail { + namespace __select_type + { using namespace __parse_int; @@ -804,7 +807,7 @@ _GLIBCXX_END_NAMESPACE_VERSION constexpr typename _Select_type<_Val, _Dur>::type _Select_type<_Val, _Dur>::value; - } // __detail + } // __select_type constexpr chrono::duration> operator"" h(long double __hours) @@ -812,11 +815,11 @@ _GLIBCXX_END_NAMESPACE_VERSION template constexpr typename - __detail::_Select_type<__select_int::_Select_int<_Digits...>::value, + __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value, chrono::hours>::type operator"" h() { - return __detail::_Select_type< + return __select_type::_Select_type< __select_int::_Select_int<_Digits...>::value, chrono::hours>::value; } @@ -827,11 +830,11 @@ _GLIBCXX_END_NAMESPACE_VERSION template constexpr typename - __detail::_Select_type<__select_int::_Select_int<_Digits...>::value, + __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value, chrono::minutes>::type operator"" min() { - return __detail::_Select_type< + return __select_type::_Select_type< __select_int::_Select_int<_Digits...>::value, chrono::minutes>::value; } @@ -842,11 +845,11 @@ _GLIBCXX_END_NAMESPACE_VERSION template constexpr typename - __detail::_Select_type<__select_int::_Select_int<_Digits...>::value, + __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value, chrono::seconds>::type operator"" s() { - return __detail::_Select_type< + return __select_type::_Select_type< __select_int::_Select_int<_Digits...>::value, chrono::seconds>::value; } @@ -857,11 +860,11 @@ _GLIBCXX_END_NAMESPACE_VERSION template constexpr typename - __detail::_Select_type<__select_int::_Select_int<_Digits...>::value, + __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value, chrono::milliseconds>::type operator"" ms() { - return __detail::_Select_type< + return __select_type::_Select_type< __select_int::_Select_int<_Digits...>::value, chrono::milliseconds>::value; } @@ -872,11 +875,11 @@ _GLIBCXX_END_NAMESPACE_VERSION template constexpr typename - __detail::_Select_type<__select_int::_Select_int<_Digits...>::value, + __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value, chrono::microseconds>::type operator"" us() { - return __detail::_Select_type< + return __select_type::_Select_type< __select_int::_Select_int<_Digits...>::value, chrono::microseconds>::value; } @@ -887,11 +890,11 @@ _GLIBCXX_END_NAMESPACE_VERSION template constexpr typename - __detail::_Select_type<__select_int::_Select_int<_Digits...>::value, + __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value, chrono::nanoseconds>::type operator"" ns() { - return __detail::_Select_type< + return __select_type::_Select_type< __select_int::_Select_int<_Digits...>::value, chrono::nanoseconds>::value; } diff --git a/libstdc++-v3/testsuite/20_util/duration/literals/ns_detail.cc b/libstdc++-v3/testsuite/20_util/duration/literals/ns_detail.cc new file mode 100644 index 00000000000..a5e21e9a3dd --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration/literals/ns_detail.cc @@ -0,0 +1,7 @@ +// { dg-options "-std=gnu++1y" } +// { dg-do compile } + +// Test error: reference to '__detail' is ambiguous + +#include +#include -- 2.11.4.GIT