]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix library literals error involving namespace __detail.
authorEd Smith-Rowland <3dw4rd@verizon.net>
Tue, 11 Jun 2013 11:00:38 +0000 (11:00 +0000)
committerEdward Smith-Rowland <emsr@gcc.gnu.org>
Tue, 11 Jun 2013 11:00:38 +0000 (11:00 +0000)
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

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/basic_string.h
libstdc++-v3/include/std/chrono
libstdc++-v3/testsuite/20_util/duration/literals/ns_detail.cc [new file with mode: 0644]

index 60bc7b5a5ebd4909060f3d98e456e1587dbfef64..bef2e0d1dd1c46da2cbfdcb93b1f62688884a200 100644 (file)
@@ -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  <paolo.carlini@oracle.com>
 
        PR libstdc++/56019
index aec48d7430ae5992400853ebd674ce2d61f55789..cbea5664e71c13fe80b3d9de1f24be42a87cff2f 100644 (file)
@@ -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<char>
     operator"" s(const char* __str, size_t __len)
index b32fb4460deec272140b0d64175dda8ae7612d74..d5ef984279d7dfbd9d8e867742b54d287030d34a 100644 (file)
@@ -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<long double, ratio<3600,1>>
     operator"" h(long double __hours)
@@ -812,11 +815,11 @@ _GLIBCXX_END_NAMESPACE_VERSION
 
     template <char... _Digits>
       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 <char... _Digits>
       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 <char... _Digits>
       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 <char... _Digits>
       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 <char... _Digits>
       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 <char... _Digits>
       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 (file)
index 0000000..a5e21e9
--- /dev/null
@@ -0,0 +1,7 @@
+// { dg-options "-std=gnu++1y" }
+// { dg-do compile }
+
+// Test error: reference to '__detail' is ambiguous
+
+#include <chrono>
+#include <random>