Commit 8ba7f29e by Jonathan Wakely Committed by Jonathan Wakely

Remove <chrono> dependency on _GLIBCXX_USE_C99_STDINT_TR1

By adding fallback definitions of std::intmax_t and std::uintmax_t it's
possible to define <ratio> without _GLIBCXX_USE_C99_STDINT_TR1. This in
turn allows most of <chrono> to be defined, which removes the dependency
on _GLIBCXX_USE_C99_STDINT_TR1 for all of the C++11 concurrency features.

The compiler defines __INTMAX_TYPE__ and __UINTMAX_TYPE__
unconditionally so it should be safe to rely on them.

	* include/bits/atomic_futex.h [!_GLIBCXX_USE_C99_STDINT_TR1]
	(__atomic_futex_unsigned_base): Remove dependency on
	_GLIBCXX_USE_C99_STDINT_TR1 macro.
	* include/bits/unique_lock.h [!_GLIBCXX_USE_C99_STDINT_TR1]
	(unique_lock): Remove dependency on _GLIBCXX_USE_C99_STDINT_TR1.
	* include/c_global/cstdint [!_GLIBCXX_USE_C99_STDINT_TR1] (intmax_t)
	(uintmax_t): Define using predefined macros.
	* include/std/chrono [!_GLIBCXX_USE_C99_STDINT_TR1] (duration)
	(time_point, system_clock, high_resolution_clock, steady_clock): Remove
	dependency on _GLIBCXX_USE_C99_STDINT_TR1 macro.
	(nanoseconds, microseconds, milliseconds, seconds, minutes, hours):
	[!_GLIBCXX_USE_C99_STDINT_TR1]: Define using __INT64_TYPE__ or
	long long when <stdint.h> is not usable.
	* include/std/condition_variable [!_GLIBCXX_USE_C99_STDINT_TR1]
	(condition_variable, condition_variable_any): Remove dependency on
	_GLIBCXX_USE_C99_STDINT_TR1.
	* include/std/future [!_GLIBCXX_USE_C99_STDINT_TR1] (future, promise)
	(packaged_task, async): Likewise.
	* include/std/mutex [!_GLIBCXX_USE_C99_STDINT_TR1] (recursive_mutex)
	(timed_mutex, recursive_timed_mutex, try_lock, lock, scoped_lock)
	(once_flag, call_once): Likewise.
	* include/std/ratio [!_GLIBCXX_USE_C99_STDINT_TR1] (ratio): Likewise.
	* include/std/shared_mutex [!_GLIBCXX_USE_C99_STDINT_TR1]
	(shared_mutex, shared_timed_mutex, shared_lock): Likewise.
	* include/std/thread [!_GLIBCXX_USE_C99_STDINT_TR1] (thread)
	(this_thread::get_id, this_thread::yield, this_thread::sleep_for)
	(this_thread::sleep_until): Likewise.
	* src/c++11/chrono.cc: Remove dependency on
	_GLIBCXX_USE_C99_STDINT_TR1 macro.
	* src/c++11/condition_variable.cc: Likewise.
	* src/c++11/futex.cc: Likewise.
	* src/c++11/future.cc: Likewise.
	* src/c++11/mutex.cc: Likewise.
	* src/c++11/thread.cc: Likewise.
	* testsuite/20_util/duration/literals/range_neg.cc: Adjust dg-error.
	* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise.
	* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
	* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
	* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Likewise.
	* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise.

From-SVN: r263001
parent 864f020a
2018-07-26 Jonathan Wakely <jwakely@redhat.com>
* include/bits/atomic_futex.h [!_GLIBCXX_USE_C99_STDINT_TR1]
(__atomic_futex_unsigned_base): Remove dependency on
_GLIBCXX_USE_C99_STDINT_TR1 macro.
* include/bits/unique_lock.h [!_GLIBCXX_USE_C99_STDINT_TR1]
(unique_lock): Remove dependency on _GLIBCXX_USE_C99_STDINT_TR1.
* include/c_global/cstdint [!_GLIBCXX_USE_C99_STDINT_TR1] (intmax_t)
(uintmax_t): Define using predefined macros.
* include/std/chrono [!_GLIBCXX_USE_C99_STDINT_TR1] (duration)
(time_point, system_clock, high_resolution_clock, steady_clock): Remove
dependency on _GLIBCXX_USE_C99_STDINT_TR1 macro.
(nanoseconds, microseconds, milliseconds, seconds, minutes, hours):
[!_GLIBCXX_USE_C99_STDINT_TR1]: Define using __INT64_TYPE__ or
long long when <stdint.h> is not usable.
* include/std/condition_variable [!_GLIBCXX_USE_C99_STDINT_TR1]
(condition_variable, condition_variable_any): Remove dependency on
_GLIBCXX_USE_C99_STDINT_TR1.
* include/std/future [!_GLIBCXX_USE_C99_STDINT_TR1] (future, promise)
(packaged_task, async): Likewise.
* include/std/mutex [!_GLIBCXX_USE_C99_STDINT_TR1] (recursive_mutex)
(timed_mutex, recursive_timed_mutex, try_lock, lock, scoped_lock)
(once_flag, call_once): Likewise.
* include/std/ratio [!_GLIBCXX_USE_C99_STDINT_TR1] (ratio): Likewise.
* include/std/shared_mutex [!_GLIBCXX_USE_C99_STDINT_TR1]
(shared_mutex, shared_timed_mutex, shared_lock): Likewise.
* include/std/thread [!_GLIBCXX_USE_C99_STDINT_TR1] (thread)
(this_thread::get_id, this_thread::yield, this_thread::sleep_for)
(this_thread::sleep_until): Likewise.
* src/c++11/chrono.cc: Remove dependency on
_GLIBCXX_USE_C99_STDINT_TR1 macro.
* src/c++11/condition_variable.cc: Likewise.
* src/c++11/futex.cc: Likewise.
* src/c++11/future.cc: Likewise.
* src/c++11/mutex.cc: Likewise.
* src/c++11/thread.cc: Likewise.
* testsuite/20_util/duration/literals/range_neg.cc: Adjust dg-error.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Likewise.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise.
2018-07-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2018-07-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR libstdc++/77691 PR libstdc++/77691
......
...@@ -48,7 +48,7 @@ namespace std _GLIBCXX_VISIBILITY(default) ...@@ -48,7 +48,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) #ifdef _GLIBCXX_HAS_GTHREADS
#if defined(_GLIBCXX_HAVE_LINUX_FUTEX) && ATOMIC_INT_LOCK_FREE > 1 #if defined(_GLIBCXX_HAVE_LINUX_FUTEX) && ATOMIC_INT_LOCK_FREE > 1
struct __atomic_futex_unsigned_base struct __atomic_futex_unsigned_base
{ {
...@@ -282,7 +282,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -282,7 +282,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}; };
#endif // _GLIBCXX_HAVE_LINUX_FUTEX && ATOMIC_INT_LOCK_FREE > 1 #endif // _GLIBCXX_HAVE_LINUX_FUTEX && ATOMIC_INT_LOCK_FREE > 1
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 #endif // _GLIBCXX_HAS_GTHREADS
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace std } // namespace std
......
...@@ -86,7 +86,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -86,7 +86,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// XXX calling thread owns mutex // XXX calling thread owns mutex
} }
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
template<typename _Clock, typename _Duration> template<typename _Clock, typename _Duration>
unique_lock(mutex_type& __m, unique_lock(mutex_type& __m,
const chrono::time_point<_Clock, _Duration>& __atime) const chrono::time_point<_Clock, _Duration>& __atime)
...@@ -100,7 +99,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -100,7 +99,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: _M_device(std::__addressof(__m)), : _M_device(std::__addressof(__m)),
_M_owns(_M_device->try_lock_for(__rtime)) _M_owns(_M_device->try_lock_for(__rtime))
{ } { }
#endif
~unique_lock() ~unique_lock()
{ {
...@@ -159,7 +157,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -159,7 +157,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
} }
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
template<typename _Clock, typename _Duration> template<typename _Clock, typename _Duration>
bool bool
try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime) try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
...@@ -189,7 +186,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -189,7 +186,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return _M_owns; return _M_owns;
} }
} }
#endif
void void
unlock() unlock()
......
...@@ -41,10 +41,9 @@ ...@@ -41,10 +41,9 @@
# include <stdint.h> # include <stdint.h>
#endif #endif
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
namespace std namespace std
{ {
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
using ::int8_t; using ::int8_t;
using ::int16_t; using ::int16_t;
using ::int32_t; using ::int32_t;
...@@ -80,9 +79,12 @@ namespace std ...@@ -80,9 +79,12 @@ namespace std
using ::uintmax_t; using ::uintmax_t;
using ::uintptr_t; using ::uintptr_t;
} // namespace std #else // !_GLIBCXX_USE_C99_STDINT_TR1
// Define the minimum needed for <ratio>, <chrono> etc.
using intmax_t = __INTMAX_TYPE__;
using uintmax_t = __UINTMAX_TYPE__;
#endif // _GLIBCXX_USE_C99_STDINT_TR1 #endif // _GLIBCXX_USE_C99_STDINT_TR1
} // namespace std
#endif // C++11 #endif // C++11
......
...@@ -41,8 +41,6 @@ ...@@ -41,8 +41,6 @@
#include <ctime> #include <ctime>
#include <bits/parse_numbers.h> // for literals support. #include <bits/parse_numbers.h> // for literals support.
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
...@@ -593,23 +591,35 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -593,23 +591,35 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const duration<_Rep2, _Period2>& __rhs) const duration<_Rep2, _Period2>& __rhs)
{ return !(__lhs < __rhs); } { return !(__lhs < __rhs); }
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
# define _GLIBCXX_CHRONO_INT64_T int64_t
#elif defined __INT64_TYPE__
# define _GLIBCXX_CHRONO_INT64_T __INT64_TYPE__
#else
static_assert(std::numeric_limits<unsigned long long>::digits >= 64,
"Representation type for nanoseconds must have at least 64 bits");
# define _GLIBCXX_CHRONO_INT64_T long long
#endif
/// nanoseconds /// nanoseconds
typedef duration<int64_t, nano> nanoseconds; typedef duration<_GLIBCXX_CHRONO_INT64_T, nano> nanoseconds;
/// microseconds /// microseconds
typedef duration<int64_t, micro> microseconds; typedef duration<_GLIBCXX_CHRONO_INT64_T, micro> microseconds;
/// milliseconds /// milliseconds
typedef duration<int64_t, milli> milliseconds; typedef duration<_GLIBCXX_CHRONO_INT64_T, milli> milliseconds;
/// seconds /// seconds
typedef duration<int64_t> seconds; typedef duration<_GLIBCXX_CHRONO_INT64_T> seconds;
/// minutes /// minutes
typedef duration<int64_t, ratio< 60>> minutes; typedef duration<_GLIBCXX_CHRONO_INT64_T, ratio< 60>> minutes;
/// hours /// hours
typedef duration<int64_t, ratio<3600>> hours; typedef duration<_GLIBCXX_CHRONO_INT64_T, ratio<3600>> hours;
#undef _GLIBCXX_CHRONO_INT64_T
/// time_point /// time_point
template<typename _Clock, typename _Dur> template<typename _Clock, typename _Dur>
...@@ -980,8 +990,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -980,8 +990,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace std } // namespace std
#endif //_GLIBCXX_USE_C99_STDINT_TR1
#endif // C++11 #endif // C++11
#endif //_GLIBCXX_CHRONO #endif //_GLIBCXX_CHRONO
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <bits/shared_ptr.h> #include <bits/shared_ptr.h>
#include <bits/cxxabi_forced.h> #include <bits/cxxabi_forced.h>
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) #if defined(_GLIBCXX_HAS_GTHREADS)
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
...@@ -319,8 +319,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -319,8 +319,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 #endif // _GLIBCXX_HAS_GTHREADS
#endif // C++11 #endif // C++11
#endif // _GLIBCXX_CONDITION_VARIABLE #endif // _GLIBCXX_CONDITION_VARIABLE
...@@ -192,7 +192,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -192,7 +192,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
future<__async_result_of<_Fn, _Args...>> future<__async_result_of<_Fn, _Args...>>
async(_Fn&& __fn, _Args&&... __args); async(_Fn&& __fn, _Args&&... __args);
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) #if defined(_GLIBCXX_HAS_GTHREADS)
/// Base class and enclosing scope. /// Base class and enclosing scope.
struct __future_base struct __future_base
...@@ -1745,7 +1745,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1745,7 +1745,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
#endif // _GLIBCXX_ASYNC_ABI_COMPAT #endif // _GLIBCXX_ASYNC_ABI_COMPAT
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 #endif // _GLIBCXX_HAS_GTHREADS
// @} group futures // @} group futures
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
......
...@@ -50,8 +50,6 @@ ...@@ -50,8 +50,6 @@
# include <bits/std_function.h> # include <bits/std_function.h>
#endif #endif
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
...@@ -703,7 +701,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -703,7 +701,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// @} group mutexes // @} group mutexes
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace
#endif // _GLIBCXX_USE_C99_STDINT_TR1
#endif // C++11 #endif // C++11
......
...@@ -36,9 +36,7 @@ ...@@ -36,9 +36,7 @@
#else #else
#include <type_traits> #include <type_traits>
#include <cstdint> #include <cstdint> // intmax_t, uintmax_t
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
...@@ -548,8 +546,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -548,8 +546,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace
#endif //_GLIBCXX_USE_C99_STDINT_TR1
#endif // C++11 #endif // C++11
#endif //_GLIBCXX_RATIO #endif //_GLIBCXX_RATIO
...@@ -46,7 +46,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -46,7 +46,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @{ * @{
*/ */
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
#ifdef _GLIBCXX_HAS_GTHREADS #ifdef _GLIBCXX_HAS_GTHREADS
#if __cplusplus >= 201703L #if __cplusplus >= 201703L
...@@ -676,8 +675,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -676,8 +675,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
swap(shared_lock<_Mutex>& __x, shared_lock<_Mutex>& __y) noexcept swap(shared_lock<_Mutex>& __x, shared_lock<_Mutex>& __y) noexcept
{ __x.swap(__y); } { __x.swap(__y); }
#endif // _GLIBCXX_USE_C99_STDINT_TR1
// @} group mutexes // @} group mutexes
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#include <bits/invoke.h> #include <bits/invoke.h>
#include <bits/gthr.h> #include <bits/gthr.h>
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) #if defined(_GLIBCXX_HAS_GTHREADS)
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
...@@ -407,7 +407,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -407,7 +407,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 #endif // _GLIBCXX_HAS_GTHREADS
#endif // C++11 #endif // C++11
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#include <bits/c++config.h> #include <bits/c++config.h>
#include <chrono> #include <chrono>
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
// Conditional inclusion of sys/time.h for gettimeofday // Conditional inclusion of sys/time.h for gettimeofday
#if !defined(_GLIBCXX_USE_CLOCK_MONOTONIC) && \ #if !defined(_GLIBCXX_USE_CLOCK_MONOTONIC) && \
!defined(_GLIBCXX_USE_CLOCK_REALTIME) && \ !defined(_GLIBCXX_USE_CLOCK_REALTIME) && \
...@@ -101,5 +99,3 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -101,5 +99,3 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace std } // namespace std
#endif // _GLIBCXX_USE_C99_STDINT_TR1
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <condition_variable> #include <condition_variable>
#include <cstdlib> #include <cstdlib>
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) #ifdef _GLIBCXX_HAS_GTHREADS
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
...@@ -155,4 +155,4 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -155,4 +155,4 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 #endif // _GLIBCXX_HAS_GTHREADS
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
#include <bits/atomic_futex.h> #include <bits/atomic_futex.h>
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) #ifdef _GLIBCXX_HAS_GTHREADS
#if defined(_GLIBCXX_HAVE_LINUX_FUTEX) && ATOMIC_INT_LOCK_FREE > 1 #if defined(_GLIBCXX_HAVE_LINUX_FUTEX) && ATOMIC_INT_LOCK_FREE > 1
#include <chrono> #include <chrono>
#include <climits> #include <climits>
...@@ -95,5 +95,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -95,5 +95,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} }
#endif #endif // defined(_GLIBCXX_HAVE_LINUX_FUTEX) && ATOMIC_INT_LOCK_FREE > 1
#endif #endif // _GLIBCXX_HAS_GTHREADS
...@@ -83,7 +83,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -83,7 +83,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const char* const char*
future_error::what() const noexcept { return logic_error::what(); } future_error::what() const noexcept { return logic_error::what(); }
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) #ifdef _GLIBCXX_HAS_GTHREADS
__future_base::_Result_base::_Result_base() = default; __future_base::_Result_base::_Result_base() = default;
__future_base::_Result_base::~_Result_base() = default; __future_base::_Result_base::~_Result_base() = default;
...@@ -110,7 +110,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -110,7 +110,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_cb = &_Make_ready::_S_run; _M_cb = &_Make_ready::_S_run;
__at_thread_exit(this); __at_thread_exit(this);
} }
#endif #endif // _GLIBCXX_HAS_GTHREADS
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace std } // namespace std
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <mutex> #include <mutex>
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) #ifdef _GLIBCXX_HAS_GTHREADS
#ifndef _GLIBCXX_HAVE_TLS #ifndef _GLIBCXX_HAVE_TLS
namespace namespace
{ {
...@@ -94,4 +94,4 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -94,4 +94,4 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace std } // namespace std
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 #endif // _GLIBCXX_HAS_GTHREADS
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <cerrno> #include <cerrno>
#include <cxxabi_forced.h> #include <cxxabi_forced.h>
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) #ifdef _GLIBCXX_HAS_GTHREADS
#if defined(_GLIBCXX_USE_GET_NPROCS) #if defined(_GLIBCXX_USE_GET_NPROCS)
# include <sys/sysinfo.h> # include <sys/sysinfo.h>
...@@ -218,4 +218,4 @@ namespace this_thread ...@@ -218,4 +218,4 @@ namespace this_thread
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace std } // namespace std
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 #endif // _GLIBCXX_HAS_GTHREADS
...@@ -26,6 +26,6 @@ test01() ...@@ -26,6 +26,6 @@ test01()
// std::numeric_limits<int64_t>::max() == 9223372036854775807; // std::numeric_limits<int64_t>::max() == 9223372036854775807;
auto h = 9223372036854775808h; auto h = 9223372036854775808h;
// { dg-error "cannot be represented" "" { target *-*-* } 898 } // { dg-error "cannot be represented" "" { target *-*-* } 908 }
} }
// { dg-prune-output "in constexpr expansion" } // needed for -O0 // { dg-prune-output "in constexpr expansion" } // needed for -O0
...@@ -30,4 +30,4 @@ void test01() ...@@ -30,4 +30,4 @@ void test01()
test_type d; // { dg-error "required from here" } test_type d; // { dg-error "required from here" }
} }
// { dg-error "rep cannot be a duration" "" { target *-*-* } 318 } // { dg-error "rep cannot be a duration" "" { target *-*-* } 316 }
...@@ -31,5 +31,5 @@ void test01() ...@@ -31,5 +31,5 @@ void test01()
test_type d; // { dg-error "required from here" } test_type d; // { dg-error "required from here" }
} }
// { dg-error "must be a specialization of ratio" "" { target *-*-* } 319 } // { dg-error "must be a specialization of ratio" "" { target *-*-* } 317 }
// { dg-prune-output "not a member" } // { dg-prune-output "not a member" }
...@@ -32,4 +32,4 @@ void test01() ...@@ -32,4 +32,4 @@ void test01()
test_type d; // { dg-error "required from here" } test_type d; // { dg-error "required from here" }
} }
// { dg-error "period must be positive" "" { target *-*-* } 321 } // { dg-error "period must be positive" "" { target *-*-* } 319 }
...@@ -45,7 +45,7 @@ test04() ...@@ -45,7 +45,7 @@ test04()
std::ratio<1,0> r1 __attribute__((unused)); // { dg-error "required from here" } std::ratio<1,0> r1 __attribute__((unused)); // { dg-error "required from here" }
} }
// { dg-error "denominator cannot be zero" "" { target *-*-* } 265 } // { dg-error "denominator cannot be zero" "" { target *-*-* } 263 }
// { dg-error "out of range" "" { target *-*-* } 266 } // { dg-error "out of range" "" { target *-*-* } 264 }
// { dg-error "overflow in constant expression" "" { target *-*-* } 61 } // { dg-error "overflow in constant expression" "" { target *-*-* } 59 }
// { dg-prune-output "not a member" } // { dg-prune-output "not a member" }
...@@ -41,10 +41,10 @@ test02() ...@@ -41,10 +41,10 @@ test02()
// { dg-error "required from here" "" { target *-*-* } 28 } // { dg-error "required from here" "" { target *-*-* } 28 }
// { dg-error "expected initializer" "" { target *-*-* } 35 } // { dg-error "expected initializer" "" { target *-*-* } 35 }
// { dg-error "expected initializer" "" { target *-*-* } 37 } // { dg-error "expected initializer" "" { target *-*-* } 37 }
// { dg-error "overflow in addition" "" { target *-*-* } 452 } // { dg-error "overflow in addition" "" { target *-*-* } 450 }
// { dg-error "overflow in multiplication" "" { target *-*-* } 95 }
// { dg-error "overflow in multiplication" "" { target *-*-* } 97 } // { dg-error "overflow in multiplication" "" { target *-*-* } 97 }
// { dg-error "overflow in multiplication" "" { target *-*-* } 99 } // { dg-error "overflow in multiplication" "" { target *-*-* } 99 }
// { dg-error "overflow in multiplication" "" { target *-*-* } 101 } // { dg-error "overflow in constant expression" "" { target *-*-* } 106 }
// { dg-error "overflow in constant expression" "" { target *-*-* } 108 }
// { dg-prune-output "out of range" } // { dg-prune-output "out of range" }
// { dg-prune-output "not usable in a constant expression" } // { dg-prune-output "not usable in a constant expression" }
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