Commit 76d0be83 by Paolo Carlini Committed by Paolo Carlini

re PR libstdc++/46303 ('mutex' is not a member of 'std' failures in…

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
parent 822a55a0
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> 2010-11-03 Benjamin Kosnik <bkoz@redhat.com>
* include/std/tuple (tuple): Make default constructors constexpr. * include/std/tuple (tuple): Make default constructors constexpr.
......
...@@ -185,15 +185,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -185,15 +185,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__safe_multiply<_R2::num, (_R1::den / __gcd)>::value>::value, __safe_multiply<_R2::num, (_R1::den / __gcd)>::value>::value,
__safe_multiply<_R1::den, (_R2::den / __gcd)>::value> type; __safe_multiply<_R1::den, (_R2::den / __gcd)>::value> type;
static const intmax_t num = type::num; static constexpr intmax_t num = type::num;
static const intmax_t den = type::den; static constexpr intmax_t den = type::den;
}; };
template<typename _R1, typename _R2> 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> template<typename _R1, typename _R2>
const intmax_t ratio_add<_R1, _R2>::den; constexpr intmax_t ratio_add<_R1, _R2>::den;
/// ratio_subtract /// ratio_subtract
template<typename _R1, typename _R2> template<typename _R1, typename _R2>
...@@ -203,15 +203,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -203,15 +203,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_R1, _R1,
ratio<-_R2::num, _R2::den>>::type type; ratio<-_R2::num, _R2::den>>::type type;
static const intmax_t num = type::num; static constexpr intmax_t num = type::num;
static const intmax_t den = type::den; static constexpr intmax_t den = type::den;
}; };
template<typename _R1, typename _R2> 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> template<typename _R1, typename _R2>
const intmax_t ratio_subtract<_R1, _R2>::den; constexpr intmax_t ratio_subtract<_R1, _R2>::den;
/// ratio_multiply /// ratio_multiply
template<typename _R1, typename _R2> template<typename _R1, typename _R2>
...@@ -230,15 +230,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -230,15 +230,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__safe_multiply<(_R1::den / __gcd2), __safe_multiply<(_R1::den / __gcd2),
(_R2::den / __gcd1)>::value> type; (_R2::den / __gcd1)>::value> type;
static const intmax_t num = type::num; static constexpr intmax_t num = type::num;
static const intmax_t den = type::den; static constexpr intmax_t den = type::den;
}; };
template<typename _R1, typename _R2> 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> template<typename _R1, typename _R2>
const intmax_t ratio_multiply<_R1, _R2>::den; constexpr intmax_t ratio_multiply<_R1, _R2>::den;
/// ratio_divide /// ratio_divide
template<typename _R1, typename _R2> template<typename _R1, typename _R2>
...@@ -250,15 +250,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -250,15 +250,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_R1, _R1,
ratio<_R2::den, _R2::num>>::type type; ratio<_R2::den, _R2::num>>::type type;
static const intmax_t num = type::num; static constexpr intmax_t num = type::num;
static const intmax_t den = type::den; static constexpr intmax_t den = type::den;
}; };
template<typename _R1, typename _R2> 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> template<typename _R1, typename _R2>
const intmax_t ratio_divide<_R1, _R2>::den; constexpr intmax_t ratio_divide<_R1, _R2>::den;
/// ratio_equal /// ratio_equal
template<typename _R1, typename _R2> template<typename _R1, typename _R2>
......
...@@ -49,6 +49,12 @@ namespace __gnu_test ...@@ -49,6 +49,12 @@ namespace __gnu_test
int main() int main()
{ {
__gnu_test::constexpr_member_data test; __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; return 0;
} }
// { dg-do compile } // { dg-do compile }
// { dg-options "-std=gnu++0x" } // { dg-options "-std=gnu++0x" }
// { dg-require-cstdint "" }
// { dg-require-gthreads "" }
// Copyright (C) 2010 Free Software Foundation, Inc. // Copyright (C) 2010 Free Software Foundation, Inc.
// //
......
// { dg-do compile } // { dg-do compile }
// { dg-options "-std=gnu++0x" } // { dg-options "-std=gnu++0x" }
// { dg-require-cstdint "" }
// { dg-require-gthreads "" }
// Copyright (C) 2010 Free Software Foundation, Inc. // Copyright (C) 2010 Free Software Foundation, Inc.
// //
......
// { dg-do compile } // { dg-do compile }
// { dg-options "-std=gnu++0x" } // { dg-options "-std=gnu++0x" }
// { dg-require-cstdint "" }
// { dg-require-gthreads "" }
// Copyright (C) 2010 Free Software Foundation, Inc. // Copyright (C) 2010 Free Software Foundation, Inc.
// //
......
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