aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2010-11-04 17:02:25 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2010-11-04 17:02:25 +0000
commit76d0be83b2b60ed61c4c85e6579b2427e223a6af (patch)
tree515e5b111dc110843d4ae59d42bfc766d20c2889
parent822a55a08e313229c340f6bf4b76c5f32b270d8e (diff)
downloadgcc-76d0be83b2b60ed61c4c85e6579b2427e223a6af.zip
gcc-76d0be83b2b60ed61c4c85e6579b2427e223a6af.tar.gz
gcc-76d0be83b2b60ed61c4c85e6579b2427e223a6af.tar.bz2
re PR libstdc++/46303 ('mutex' is not a member of 'std' failures in 30_threads/call_once/constexpr.cc, 30_threads/mutex/cons/constexpr.cc, 30_threads/once_flag/cons/constexpr.cc)
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
-rw-r--r--libstdc++-v3/ChangeLog14
-rw-r--r--libstdc++-v3/include/std/ratio32
-rw-r--r--libstdc++-v3/testsuite/20_util/ratio/requirements/constexpr_data.cc8
-rw-r--r--libstdc++-v3/testsuite/30_threads/call_once/constexpr.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/mutex/cons/constexpr.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/once_flag/cons/constexpr.cc2
6 files changed, 43 insertions, 17 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index acc4f58..8ea46f0 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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.
diff --git a/libstdc++-v3/include/std/ratio b/libstdc++-v3/include/std/ratio
index b424ef3..80c5d15 100644
--- a/libstdc++-v3/include/std/ratio
+++ b/libstdc++-v3/include/std/ratio
@@ -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>
diff --git a/libstdc++-v3/testsuite/20_util/ratio/requirements/constexpr_data.cc b/libstdc++-v3/testsuite/20_util/ratio/requirements/constexpr_data.cc
index 2665a81..d3a1543 100644
--- a/libstdc++-v3/testsuite/20_util/ratio/requirements/constexpr_data.cc
+++ b/libstdc++-v3/testsuite/20_util/ratio/requirements/constexpr_data.cc
@@ -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;
}
diff --git a/libstdc++-v3/testsuite/30_threads/call_once/constexpr.cc b/libstdc++-v3/testsuite/30_threads/call_once/constexpr.cc
index 9518b72..56efa06 100644
--- a/libstdc++-v3/testsuite/30_threads/call_once/constexpr.cc
+++ b/libstdc++-v3/testsuite/30_threads/call_once/constexpr.cc
@@ -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.
//
diff --git a/libstdc++-v3/testsuite/30_threads/mutex/cons/constexpr.cc b/libstdc++-v3/testsuite/30_threads/mutex/cons/constexpr.cc
index 9518b72..56efa06 100644
--- a/libstdc++-v3/testsuite/30_threads/mutex/cons/constexpr.cc
+++ b/libstdc++-v3/testsuite/30_threads/mutex/cons/constexpr.cc
@@ -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.
//
diff --git a/libstdc++-v3/testsuite/30_threads/once_flag/cons/constexpr.cc b/libstdc++-v3/testsuite/30_threads/once_flag/cons/constexpr.cc
index 52f3b5d..4f238de 100644
--- a/libstdc++-v3/testsuite/30_threads/once_flag/cons/constexpr.cc
+++ b/libstdc++-v3/testsuite/30_threads/once_flag/cons/constexpr.cc
@@ -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.
//