re PR libstdc++/46303 ('mutex' is not a member of 'std' failures in 30_threads/call_o...
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 4 Nov 2010 17:02:25 +0000 (17:02 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 4 Nov 2010 17:02:25 +0000 (17:02 +0000)
2010-11-04  Paolo Carlini  <paolo.carlini@oracle.com>

PR libstdc++/46303
* testsuite/30_threads/call_once/constexpr.cc: Add missing dg-require
directives.
* testsuite/30_threads/mutex/cons/constexpr.cc: Likewise.
* testsuite/30_threads/once_flag/cons/constexpr.cc: Likewise.

2010-11-04  Paolo Carlini  <paolo.carlini@oracle.com>

* include/std/ratio (ratio_add, ratio_subtract, ratio_multiply,
ratio_divide): Declare the data members constexpr.
* testsuite/20_util/ratio/requirements/constexpr_data.cc: Extend.

From-SVN: r166319

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/ratio
libstdc++-v3/testsuite/20_util/ratio/requirements/constexpr_data.cc
libstdc++-v3/testsuite/30_threads/call_once/constexpr.cc
libstdc++-v3/testsuite/30_threads/mutex/cons/constexpr.cc
libstdc++-v3/testsuite/30_threads/once_flag/cons/constexpr.cc

index acc4f5821505fb0443d22f6e654f44a8c466cfa1..8ea46f0847d2e4a2fada6b0108d1806d99cf4577 100644 (file)
@@ -1,3 +1,17 @@
+2010-11-04  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR libstdc++/46303
+       * testsuite/30_threads/call_once/constexpr.cc: Add missing dg-require
+       directives.
+       * testsuite/30_threads/mutex/cons/constexpr.cc: Likewise.
+       * testsuite/30_threads/once_flag/cons/constexpr.cc: Likewise.
+
+2010-11-04  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * include/std/ratio (ratio_add, ratio_subtract, ratio_multiply,
+       ratio_divide): Declare the data members constexpr.
+       * testsuite/20_util/ratio/requirements/constexpr_data.cc: Extend.
+
 2010-11-03  Benjamin Kosnik  <bkoz@redhat.com>
 
        * include/std/tuple (tuple): Make default constructors constexpr.
index b424ef341a4ac044c97c48c68e54f1fee05461ac..80c5d15e789ae4d7aed46966f033af3e2dbb89a6 100644 (file)
@@ -185,15 +185,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
           __safe_multiply<_R2::num, (_R1::den / __gcd)>::value>::value,
         __safe_multiply<_R1::den, (_R2::den / __gcd)>::value> type;
 
-      static const intmax_t num = type::num;
-      static const intmax_t den = type::den;
+      static constexpr intmax_t num = type::num;
+      static constexpr intmax_t den = type::den;
     };
 
   template<typename _R1, typename _R2>
-    const intmax_t ratio_add<_R1, _R2>::num;
+    constexpr intmax_t ratio_add<_R1, _R2>::num;
 
   template<typename _R1, typename _R2>
-    const intmax_t ratio_add<_R1, _R2>::den;
+    constexpr intmax_t ratio_add<_R1, _R2>::den;
 
   /// ratio_subtract
   template<typename _R1, typename _R2>
@@ -203,15 +203,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
         _R1,
         ratio<-_R2::num, _R2::den>>::type type;
 
-      static const intmax_t num = type::num;
-      static const intmax_t den = type::den;
+      static constexpr intmax_t num = type::num;
+      static constexpr intmax_t den = type::den;
     };
 
   template<typename _R1, typename _R2>
-    const intmax_t ratio_subtract<_R1, _R2>::num;
+    constexpr intmax_t ratio_subtract<_R1, _R2>::num;
 
   template<typename _R1, typename _R2>
-    const intmax_t ratio_subtract<_R1, _R2>::den;
+    constexpr intmax_t ratio_subtract<_R1, _R2>::den;
 
   /// ratio_multiply
   template<typename _R1, typename _R2>
@@ -230,15 +230,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
         __safe_multiply<(_R1::den / __gcd2),
                         (_R2::den / __gcd1)>::value> type;
 
-      static const intmax_t num = type::num;
-      static const intmax_t den = type::den;
+      static constexpr intmax_t num = type::num;
+      static constexpr intmax_t den = type::den;
     };
 
   template<typename _R1, typename _R2>
-    const intmax_t ratio_multiply<_R1, _R2>::num;
+    constexpr intmax_t ratio_multiply<_R1, _R2>::num;
 
   template<typename _R1, typename _R2>
-    const intmax_t ratio_multiply<_R1, _R2>::den;
+    constexpr intmax_t ratio_multiply<_R1, _R2>::den;
 
   /// ratio_divide
   template<typename _R1, typename _R2>
@@ -250,15 +250,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
         _R1,
         ratio<_R2::den, _R2::num>>::type type;
 
-      static const intmax_t num = type::num;
-      static const intmax_t den = type::den;
+      static constexpr intmax_t num = type::num;
+      static constexpr intmax_t den = type::den;
     };
 
   template<typename _R1, typename _R2>
-    const intmax_t ratio_divide<_R1, _R2>::num;
+    constexpr intmax_t ratio_divide<_R1, _R2>::num;
 
   template<typename _R1, typename _R2>
-    const intmax_t ratio_divide<_R1, _R2>::den;
+    constexpr intmax_t ratio_divide<_R1, _R2>::den;
 
   /// ratio_equal
   template<typename _R1, typename _R2>
index 2665a815f4ba848f41fbb0d3a398fc402aacd993..d3a1543deca296ede3386cfac31cce277ede4694 100644 (file)
@@ -49,6 +49,12 @@ namespace __gnu_test
 int main()
 {
   __gnu_test::constexpr_member_data test;
-  test.operator()<std::ratio<600, 900>>();
+  typedef std::ratio<600, 900> R1;
+  typedef std::ratio<700, 200> R2;
+  test.operator()<R1>();
+  test.operator()<std::ratio_add<R1, R2>>();
+  test.operator()<std::ratio_subtract<R1, R2>>();
+  test.operator()<std::ratio_multiply<R1, R2>>();
+  test.operator()<std::ratio_divide<R1, R2>>();
   return 0;
 }
index 9518b72ea9262f92f19a1e5e5c1d417629c42169..56efa06146b0f0e281d82572327289140bc49ede 100644 (file)
@@ -1,5 +1,7 @@
 // { dg-do compile }
 // { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
 
 // Copyright (C) 2010 Free Software Foundation, Inc.
 //
index 9518b72ea9262f92f19a1e5e5c1d417629c42169..56efa06146b0f0e281d82572327289140bc49ede 100644 (file)
@@ -1,5 +1,7 @@
 // { dg-do compile }
 // { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
 
 // Copyright (C) 2010 Free Software Foundation, Inc.
 //
index 52f3b5d3d4d35731da3962bb6b630b4da7d672d6..4f238de9b3caa9652009edf19db1ee06295da6ad 100644 (file)
@@ -1,5 +1,7 @@
 // { dg-do compile }
 // { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
 
 // Copyright (C) 2010 Free Software Foundation, Inc.
 //