Commit 0372af98 by Ed Smith-Rowland Committed by Edward Smith-Rowland

Fix library literals error involving namespace __detail.

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.

From-SVN: r199948
parent 899e00eb
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 <paolo.carlini@oracle.com> 2013-06-11 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/56019 PR libstdc++/56019
......
...@@ -3105,8 +3105,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -3105,8 +3105,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus > 201103L #if __cplusplus > 201103L
inline namespace literals { inline namespace literals
inline namespace string_literals { {
inline namespace string_literals
{
inline basic_string<char> inline basic_string<char>
operator"" s(const char* __str, size_t __len) operator"" s(const char* __str, size_t __len)
......
...@@ -782,10 +782,13 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -782,10 +782,13 @@ _GLIBCXX_END_NAMESPACE_VERSION
#if __cplusplus > 201103L #if __cplusplus > 201103L
inline namespace literals { inline namespace literals
inline namespace chrono_literals { {
inline namespace chrono_literals
{
namespace __detail { namespace __select_type
{
using namespace __parse_int; using namespace __parse_int;
...@@ -804,7 +807,7 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -804,7 +807,7 @@ _GLIBCXX_END_NAMESPACE_VERSION
constexpr typename _Select_type<_Val, _Dur>::type constexpr typename _Select_type<_Val, _Dur>::type
_Select_type<_Val, _Dur>::value; _Select_type<_Val, _Dur>::value;
} // __detail } // __select_type
constexpr chrono::duration<long double, ratio<3600,1>> constexpr chrono::duration<long double, ratio<3600,1>>
operator"" h(long double __hours) operator"" h(long double __hours)
...@@ -812,11 +815,11 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -812,11 +815,11 @@ _GLIBCXX_END_NAMESPACE_VERSION
template <char... _Digits> template <char... _Digits>
constexpr typename constexpr typename
__detail::_Select_type<__select_int::_Select_int<_Digits...>::value, __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value,
chrono::hours>::type chrono::hours>::type
operator"" h() operator"" h()
{ {
return __detail::_Select_type< return __select_type::_Select_type<
__select_int::_Select_int<_Digits...>::value, __select_int::_Select_int<_Digits...>::value,
chrono::hours>::value; chrono::hours>::value;
} }
...@@ -827,11 +830,11 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -827,11 +830,11 @@ _GLIBCXX_END_NAMESPACE_VERSION
template <char... _Digits> template <char... _Digits>
constexpr typename constexpr typename
__detail::_Select_type<__select_int::_Select_int<_Digits...>::value, __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value,
chrono::minutes>::type chrono::minutes>::type
operator"" min() operator"" min()
{ {
return __detail::_Select_type< return __select_type::_Select_type<
__select_int::_Select_int<_Digits...>::value, __select_int::_Select_int<_Digits...>::value,
chrono::minutes>::value; chrono::minutes>::value;
} }
...@@ -842,11 +845,11 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -842,11 +845,11 @@ _GLIBCXX_END_NAMESPACE_VERSION
template <char... _Digits> template <char... _Digits>
constexpr typename constexpr typename
__detail::_Select_type<__select_int::_Select_int<_Digits...>::value, __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value,
chrono::seconds>::type chrono::seconds>::type
operator"" s() operator"" s()
{ {
return __detail::_Select_type< return __select_type::_Select_type<
__select_int::_Select_int<_Digits...>::value, __select_int::_Select_int<_Digits...>::value,
chrono::seconds>::value; chrono::seconds>::value;
} }
...@@ -857,11 +860,11 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -857,11 +860,11 @@ _GLIBCXX_END_NAMESPACE_VERSION
template <char... _Digits> template <char... _Digits>
constexpr typename constexpr typename
__detail::_Select_type<__select_int::_Select_int<_Digits...>::value, __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value,
chrono::milliseconds>::type chrono::milliseconds>::type
operator"" ms() operator"" ms()
{ {
return __detail::_Select_type< return __select_type::_Select_type<
__select_int::_Select_int<_Digits...>::value, __select_int::_Select_int<_Digits...>::value,
chrono::milliseconds>::value; chrono::milliseconds>::value;
} }
...@@ -872,11 +875,11 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -872,11 +875,11 @@ _GLIBCXX_END_NAMESPACE_VERSION
template <char... _Digits> template <char... _Digits>
constexpr typename constexpr typename
__detail::_Select_type<__select_int::_Select_int<_Digits...>::value, __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value,
chrono::microseconds>::type chrono::microseconds>::type
operator"" us() operator"" us()
{ {
return __detail::_Select_type< return __select_type::_Select_type<
__select_int::_Select_int<_Digits...>::value, __select_int::_Select_int<_Digits...>::value,
chrono::microseconds>::value; chrono::microseconds>::value;
} }
...@@ -887,11 +890,11 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -887,11 +890,11 @@ _GLIBCXX_END_NAMESPACE_VERSION
template <char... _Digits> template <char... _Digits>
constexpr typename constexpr typename
__detail::_Select_type<__select_int::_Select_int<_Digits...>::value, __select_type::_Select_type<__select_int::_Select_int<_Digits...>::value,
chrono::nanoseconds>::type chrono::nanoseconds>::type
operator"" ns() operator"" ns()
{ {
return __detail::_Select_type< return __select_type::_Select_type<
__select_int::_Select_int<_Digits...>::value, __select_int::_Select_int<_Digits...>::value,
chrono::nanoseconds>::value; chrono::nanoseconds>::value;
} }
......
// { dg-options "-std=gnu++1y" }
// { dg-do compile }
// Test error: reference to '__detail' is ambiguous
#include <chrono>
#include <random>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment