[cfe-commits] [libcxx] r145698 - in /libcxx/trunk: include/__config include/future include/ios include/support/win32/support.h include/system_error test/diagnostics/syserr/errc.pass.cpp test/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp test/thread/futures/futures.errors/default_error_condition.pass.cpp test/thread/futures/futures.overview/future_errc.pass.cpp test/thread/futures/futures.overview/future_status.pass.cpp test/thread/futures/futures.overview/launch.pass.cpp
Howard Hinnant
hhinnant at apple.com
Fri Dec 2 11:36:40 PST 2011
Author: hhinnant
Date: Fri Dec 2 13:36:40 2011
New Revision: 145698
URL: http://llvm.org/viewvc/llvm-project?rev=145698&view=rev
Log:
Fix http://llvm.org/bugs/show_bug.cgi?id=11428. Fix provided by Alberto Ganesh Barbati
Modified:
libcxx/trunk/include/__config
libcxx/trunk/include/future
libcxx/trunk/include/ios
libcxx/trunk/include/support/win32/support.h
libcxx/trunk/include/system_error
libcxx/trunk/test/diagnostics/syserr/errc.pass.cpp
libcxx/trunk/test/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp
libcxx/trunk/test/thread/futures/futures.errors/default_error_condition.pass.cpp
libcxx/trunk/test/thread/futures/futures.overview/future_errc.pass.cpp
libcxx/trunk/test/thread/futures/futures.overview/future_status.pass.cpp
libcxx/trunk/test/thread/futures/futures.overview/launch.pass.cpp
Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=145698&r1=145697&r2=145698&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Fri Dec 2 13:36:40 2011
@@ -160,6 +160,10 @@
#define _LIBCPP_NO_RTTI
#endif
+#if !(__has_feature(cxx_strong_enums))
+#define _LIBCPP_HAS_NO_STRONG_ENUMS
+#endif
+
#if !(__has_feature(cxx_decltype))
#define _LIBCPP_HAS_NO_DECLTYPE
#endif
@@ -223,6 +227,7 @@
#if __has_feature(objc_arc_weak)
#define _LIBCPP_HAS_OBJC_ARC_WEAK
+#define _LIBCPP_HAS_NO_STRONG_ENUMS
#endif
#if !(__has_feature(cxx_constexpr))
@@ -371,6 +376,18 @@
#define __has_feature(__x) 0
#endif
+#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
+#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_VISIBLE x { enum _
+#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
+ _ __v_; \
+ _LIBCPP_ALWAYS_INLINE x(_ __v) : __v_(__v) {} \
+ _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
+ };
+#else // _LIBCPP_HAS_NO_STRONG_ENUMS
+#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_VISIBLE x
+#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
+#endif // _LIBCPP_HAS_NO_STRONG_ENUMS
+
#if __APPLE__ || __FreeBSD__ || _WIN32
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
#endif
Modified: libcxx/trunk/include/future
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/future?rev=145698&r1=145697&r2=145698&view=diff
==============================================================================
--- libcxx/trunk/include/future (original)
+++ libcxx/trunk/include/future Fri Dec 2 13:36:40 2011
@@ -377,56 +377,40 @@
_LIBCPP_BEGIN_NAMESPACE_STD
//enum class future_errc
-struct _LIBCPP_VISIBLE future_errc
+_LIBCPP_DECLARE_STRONG_ENUM(future_errc)
{
-enum _ {
broken_promise,
future_already_retrieved,
promise_already_satisfied,
no_state
};
-
- _ __v_;
-
- _LIBCPP_INLINE_VISIBILITY future_errc(_ __v) : __v_(__v) {}
- _LIBCPP_INLINE_VISIBILITY operator int() const {return __v_;}
-
-};
+_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_errc)
template <>
struct _LIBCPP_VISIBLE is_error_code_enum<future_errc> : public true_type {};
+#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
+template <>
+struct _LIBCPP_VISIBLE is_error_code_enum<future_errc::_> : public true_type { };
+#endif
+
//enum class launch
-struct _LIBCPP_VISIBLE launch
+_LIBCPP_DECLARE_STRONG_ENUM(launch)
{
-enum _ {
async = 1,
deferred = 2,
any = async | deferred
};
-
- _ __v_;
-
- _LIBCPP_INLINE_VISIBILITY launch(_ __v) : __v_(__v) {}
- _LIBCPP_INLINE_VISIBILITY operator int() const {return __v_;}
-
-};
+_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(launch)
//enum class future_status
-struct _LIBCPP_VISIBLE future_status
+_LIBCPP_DECLARE_STRONG_ENUM(future_status)
{
-enum _ {
ready,
timeout,
deferred
};
-
- _ __v_;
-
- _LIBCPP_INLINE_VISIBILITY future_status(_ __v) : __v_(__v) {}
- _LIBCPP_INLINE_VISIBILITY operator int() const {return __v_;}
-
-};
+_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_status)
_LIBCPP_VISIBLE
const error_category& future_category();
@@ -2252,10 +2236,10 @@
typedef __async_func<typename decay<_Fp>::type, typename decay<_Args>::type...> _BF;
typedef typename _BF::_Rp _Rp;
future<_Rp> __r;
- if (__policy & launch::async)
+ if (int(__policy) & int(launch::async))
__r = _VSTD::__make_async_assoc_state<_Rp>(_BF(__decay_copy(_VSTD::forward<_Fp>(__f)),
__decay_copy(_VSTD::forward<_Args>(__args))...));
- else if (__policy & launch::deferred)
+ else if (int(__policy) & int(launch::deferred))
__r = _VSTD::__make_deferred_assoc_state<_Rp>(_BF(__decay_copy(_VSTD::forward<_Fp>(__f)),
__decay_copy(_VSTD::forward<_Args>(__args))...));
return __r;
Modified: libcxx/trunk/include/ios
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/ios?rev=145698&r1=145697&r2=145698&view=diff
==============================================================================
--- libcxx/trunk/include/ios (original)
+++ libcxx/trunk/include/ios Fri Dec 2 13:36:40 2011
@@ -373,21 +373,19 @@
};
//enum class io_errc
-struct _LIBCPP_VISIBLE io_errc
+_LIBCPP_DECLARE_STRONG_ENUM(io_errc)
{
-enum _ {
stream = 1
};
- _ __v_;
-
- _LIBCPP_ALWAYS_INLINE io_errc(_ __v) : __v_(__v) {}
- _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;}
-};
+_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)
template <>
struct _LIBCPP_VISIBLE is_error_code_enum<io_errc> : public true_type { };
+
+#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
template <>
struct _LIBCPP_VISIBLE is_error_code_enum<io_errc::_> : public true_type { };
+#endif
_LIBCPP_VISIBLE
const error_category& iostream_category();
Modified: libcxx/trunk/include/support/win32/support.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/support/win32/support.h?rev=145698&r1=145697&r2=145698&view=diff
==============================================================================
--- libcxx/trunk/include/support/win32/support.h (original)
+++ libcxx/trunk/include/support/win32/support.h Fri Dec 2 13:36:40 2011
@@ -31,7 +31,7 @@
size_t nmc, size_t len, mbstate_t *__restrict ps );
size_t wcsnrtombs( char *__restrict dst, const wchar_t **__restrict src,
size_t nwc, size_t len, mbstate_t *__restrict ps );
-
+
#if defined(_MSC_VER)
#define snprintf _snprintf
@@ -91,8 +91,8 @@
_LIBCPP_ALWAYS_INLINE int __builtin_ctzll( unsigned long long x )
{
DWORD r = 0;
- _BitScanReverse64(&r, x);
- return static_cast<int>(r);
+ _BitScanReverse64(&r, x);
+ return static_cast<int>(r);
}
_LIBCPP_ALWAYS_INLINE int __builtin_clz( unsigned int x )
{
@@ -106,8 +106,8 @@
_LIBCPP_ALWAYS_INLINE int __builtin_clzll( unsigned long long x )
{
DWORD r = 0;
- _BitScanForward64(&r, x);
- return static_cast<int>(r);
+ _BitScanForward64(&r, x);
+ return static_cast<int>(r);
}
#endif // !__clang__
#endif // _MSC_VER
Modified: libcxx/trunk/include/system_error
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/system_error?rev=145698&r1=145697&r2=145698&view=diff
==============================================================================
--- libcxx/trunk/include/system_error (original)
+++ libcxx/trunk/include/system_error Fri Dec 2 13:36:40 2011
@@ -245,9 +245,8 @@
// for them:
//enum class errc
-struct errc
+_LIBCPP_DECLARE_STRONG_ENUM(errc)
{
-enum _ {
address_family_not_supported = EAFNOSUPPORT,
address_in_use = EADDRINUSE,
address_not_available = EADDRNOTAVAIL,
@@ -343,23 +342,17 @@
value_too_large = EOVERFLOW,
wrong_protocol_type = EPROTOTYPE
};
-
- _ __v_;
-
- _LIBCPP_ALWAYS_INLINE
- errc(_ __v) : __v_(__v) {}
- _LIBCPP_ALWAYS_INLINE
- operator int() const {return __v_;}
-
-};
+_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(errc)
template <>
struct _LIBCPP_VISIBLE is_error_condition_enum<errc>
: true_type { };
+#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
template <>
struct _LIBCPP_VISIBLE is_error_condition_enum<errc::_>
: true_type { };
+#endif
class error_condition;
class error_code;
Modified: libcxx/trunk/test/diagnostics/syserr/errc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/diagnostics/syserr/errc.pass.cpp?rev=145698&r1=145697&r2=145698&view=diff
==============================================================================
--- libcxx/trunk/test/diagnostics/syserr/errc.pass.cpp (original)
+++ libcxx/trunk/test/diagnostics/syserr/errc.pass.cpp Fri Dec 2 13:36:40 2011
@@ -15,90 +15,90 @@
int main()
{
- static_assert(std::errc::address_family_not_supported == EAFNOSUPPORT, "");
- static_assert(std::errc::address_in_use == EADDRINUSE, "");
- static_assert(std::errc::address_not_available == EADDRNOTAVAIL, "");
- static_assert(std::errc::already_connected == EISCONN, "");
- static_assert(std::errc::argument_list_too_long == E2BIG, "");
- static_assert(std::errc::argument_out_of_domain == EDOM, "");
- static_assert(std::errc::bad_address == EFAULT, "");
- static_assert(std::errc::bad_file_descriptor == EBADF, "");
- static_assert(std::errc::bad_message == EBADMSG, "");
- static_assert(std::errc::broken_pipe == EPIPE, "");
- static_assert(std::errc::connection_aborted == ECONNABORTED, "");
- static_assert(std::errc::connection_already_in_progress == EALREADY, "");
- static_assert(std::errc::connection_refused == ECONNREFUSED, "");
- static_assert(std::errc::connection_reset == ECONNRESET, "");
- static_assert(std::errc::cross_device_link == EXDEV, "");
- static_assert(std::errc::destination_address_required == EDESTADDRREQ, "");
- static_assert(std::errc::device_or_resource_busy == EBUSY, "");
- static_assert(std::errc::directory_not_empty == ENOTEMPTY, "");
- static_assert(std::errc::executable_format_error == ENOEXEC, "");
- static_assert(std::errc::file_exists == EEXIST, "");
- static_assert(std::errc::file_too_large == EFBIG, "");
- static_assert(std::errc::filename_too_long == ENAMETOOLONG, "");
- static_assert(std::errc::function_not_supported == ENOSYS, "");
- static_assert(std::errc::host_unreachable == EHOSTUNREACH, "");
- static_assert(std::errc::identifier_removed == EIDRM, "");
- static_assert(std::errc::illegal_byte_sequence == EILSEQ, "");
- static_assert(std::errc::inappropriate_io_control_operation == ENOTTY, "");
- static_assert(std::errc::interrupted == EINTR, "");
- static_assert(std::errc::invalid_argument == EINVAL, "");
- static_assert(std::errc::invalid_seek == ESPIPE, "");
- static_assert(std::errc::io_error == EIO, "");
- static_assert(std::errc::is_a_directory == EISDIR, "");
- static_assert(std::errc::message_size == EMSGSIZE, "");
- static_assert(std::errc::network_down == ENETDOWN, "");
- static_assert(std::errc::network_reset == ENETRESET, "");
- static_assert(std::errc::network_unreachable == ENETUNREACH, "");
- static_assert(std::errc::no_buffer_space == ENOBUFS, "");
- static_assert(std::errc::no_child_process == ECHILD, "");
- static_assert(std::errc::no_link == ENOLINK, "");
- static_assert(std::errc::no_lock_available == ENOLCK, "");
+ static_assert(static_cast<int>(std::errc::address_family_not_supported) == EAFNOSUPPORT, "");
+ static_assert(static_cast<int>(std::errc::address_in_use) == EADDRINUSE, "");
+ static_assert(static_cast<int>(std::errc::address_not_available) == EADDRNOTAVAIL, "");
+ static_assert(static_cast<int>(std::errc::already_connected) == EISCONN, "");
+ static_assert(static_cast<int>(std::errc::argument_list_too_long) == E2BIG, "");
+ static_assert(static_cast<int>(std::errc::argument_out_of_domain) == EDOM, "");
+ static_assert(static_cast<int>(std::errc::bad_address) == EFAULT, "");
+ static_assert(static_cast<int>(std::errc::bad_file_descriptor) == EBADF, "");
+ static_assert(static_cast<int>(std::errc::bad_message) == EBADMSG, "");
+ static_assert(static_cast<int>(std::errc::broken_pipe) == EPIPE, "");
+ static_assert(static_cast<int>(std::errc::connection_aborted) == ECONNABORTED, "");
+ static_assert(static_cast<int>(std::errc::connection_already_in_progress) == EALREADY, "");
+ static_assert(static_cast<int>(std::errc::connection_refused) == ECONNREFUSED, "");
+ static_assert(static_cast<int>(std::errc::connection_reset) == ECONNRESET, "");
+ static_assert(static_cast<int>(std::errc::cross_device_link) == EXDEV, "");
+ static_assert(static_cast<int>(std::errc::destination_address_required) == EDESTADDRREQ, "");
+ static_assert(static_cast<int>(std::errc::device_or_resource_busy) == EBUSY, "");
+ static_assert(static_cast<int>(std::errc::directory_not_empty) == ENOTEMPTY, "");
+ static_assert(static_cast<int>(std::errc::executable_format_error) == ENOEXEC, "");
+ static_assert(static_cast<int>(std::errc::file_exists) == EEXIST, "");
+ static_assert(static_cast<int>(std::errc::file_too_large) == EFBIG, "");
+ static_assert(static_cast<int>(std::errc::filename_too_long) == ENAMETOOLONG, "");
+ static_assert(static_cast<int>(std::errc::function_not_supported) == ENOSYS, "");
+ static_assert(static_cast<int>(std::errc::host_unreachable) == EHOSTUNREACH, "");
+ static_assert(static_cast<int>(std::errc::identifier_removed) == EIDRM, "");
+ static_assert(static_cast<int>(std::errc::illegal_byte_sequence) == EILSEQ, "");
+ static_assert(static_cast<int>(std::errc::inappropriate_io_control_operation) == ENOTTY, "");
+ static_assert(static_cast<int>(std::errc::interrupted) == EINTR, "");
+ static_assert(static_cast<int>(std::errc::invalid_argument) == EINVAL, "");
+ static_assert(static_cast<int>(std::errc::invalid_seek) == ESPIPE, "");
+ static_assert(static_cast<int>(std::errc::io_error) == EIO, "");
+ static_assert(static_cast<int>(std::errc::is_a_directory) == EISDIR, "");
+ static_assert(static_cast<int>(std::errc::message_size) == EMSGSIZE, "");
+ static_assert(static_cast<int>(std::errc::network_down) == ENETDOWN, "");
+ static_assert(static_cast<int>(std::errc::network_reset) == ENETRESET, "");
+ static_assert(static_cast<int>(std::errc::network_unreachable) == ENETUNREACH, "");
+ static_assert(static_cast<int>(std::errc::no_buffer_space) == ENOBUFS, "");
+ static_assert(static_cast<int>(std::errc::no_child_process) == ECHILD, "");
+ static_assert(static_cast<int>(std::errc::no_link) == ENOLINK, "");
+ static_assert(static_cast<int>(std::errc::no_lock_available) == ENOLCK, "");
#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
- static_assert(std::errc::no_message_available == ENODATA, "");
+ static_assert(static_cast<int>(std::errc::no_message_available) == ENODATA, "");
#endif
- static_assert(std::errc::no_message == ENOMSG, "");
- static_assert(std::errc::no_protocol_option == ENOPROTOOPT, "");
- static_assert(std::errc::no_space_on_device == ENOSPC, "");
+ static_assert(static_cast<int>(std::errc::no_message) == ENOMSG, "");
+ static_assert(static_cast<int>(std::errc::no_protocol_option) == ENOPROTOOPT, "");
+ static_assert(static_cast<int>(std::errc::no_space_on_device) == ENOSPC, "");
#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
- static_assert(std::errc::no_stream_resources == ENOSR, "");
+ static_assert(static_cast<int>(std::errc::no_stream_resources) == ENOSR, "");
#endif
- static_assert(std::errc::no_such_device_or_address == ENXIO, "");
- static_assert(std::errc::no_such_device == ENODEV, "");
- static_assert(std::errc::no_such_file_or_directory == ENOENT, "");
- static_assert(std::errc::no_such_process == ESRCH, "");
- static_assert(std::errc::not_a_directory == ENOTDIR, "");
- static_assert(std::errc::not_a_socket == ENOTSOCK, "");
+ static_assert(static_cast<int>(std::errc::no_such_device_or_address) == ENXIO, "");
+ static_assert(static_cast<int>(std::errc::no_such_device) == ENODEV, "");
+ static_assert(static_cast<int>(std::errc::no_such_file_or_directory) == ENOENT, "");
+ static_assert(static_cast<int>(std::errc::no_such_process) == ESRCH, "");
+ static_assert(static_cast<int>(std::errc::not_a_directory) == ENOTDIR, "");
+ static_assert(static_cast<int>(std::errc::not_a_socket) == ENOTSOCK, "");
#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
- static_assert(std::errc::not_a_stream == ENOSTR, "");
+ static_assert(static_cast<int>(std::errc::not_a_stream) == ENOSTR, "");
#endif
- static_assert(std::errc::not_connected == ENOTCONN, "");
- static_assert(std::errc::not_enough_memory == ENOMEM, "");
- static_assert(std::errc::not_supported == ENOTSUP, "");
- static_assert(std::errc::operation_canceled == ECANCELED, "");
- static_assert(std::errc::operation_in_progress == EINPROGRESS, "");
- static_assert(std::errc::operation_not_permitted == EPERM, "");
- static_assert(std::errc::operation_not_supported == EOPNOTSUPP, "");
- static_assert(std::errc::operation_would_block == EWOULDBLOCK, "");
- static_assert(std::errc::owner_dead == EOWNERDEAD, "");
- static_assert(std::errc::permission_denied == EACCES, "");
- static_assert(std::errc::protocol_error == EPROTO, "");
- static_assert(std::errc::protocol_not_supported == EPROTONOSUPPORT, "");
- static_assert(std::errc::read_only_file_system == EROFS, "");
- static_assert(std::errc::resource_deadlock_would_occur == EDEADLK, "");
- static_assert(std::errc::resource_unavailable_try_again == EAGAIN, "");
- static_assert(std::errc::result_out_of_range == ERANGE, "");
- static_assert(std::errc::state_not_recoverable == ENOTRECOVERABLE, "");
+ static_assert(static_cast<int>(std::errc::not_connected) == ENOTCONN, "");
+ static_assert(static_cast<int>(std::errc::not_enough_memory) == ENOMEM, "");
+ static_assert(static_cast<int>(std::errc::not_supported) == ENOTSUP, "");
+ static_assert(static_cast<int>(std::errc::operation_canceled) == ECANCELED, "");
+ static_assert(static_cast<int>(std::errc::operation_in_progress) == EINPROGRESS, "");
+ static_assert(static_cast<int>(std::errc::operation_not_permitted) == EPERM, "");
+ static_assert(static_cast<int>(std::errc::operation_not_supported) == EOPNOTSUPP, "");
+ static_assert(static_cast<int>(std::errc::operation_would_block) == EWOULDBLOCK, "");
+ static_assert(static_cast<int>(std::errc::owner_dead) == EOWNERDEAD, "");
+ static_assert(static_cast<int>(std::errc::permission_denied) == EACCES, "");
+ static_assert(static_cast<int>(std::errc::protocol_error) == EPROTO, "");
+ static_assert(static_cast<int>(std::errc::protocol_not_supported) == EPROTONOSUPPORT, "");
+ static_assert(static_cast<int>(std::errc::read_only_file_system) == EROFS, "");
+ static_assert(static_cast<int>(std::errc::resource_deadlock_would_occur) == EDEADLK, "");
+ static_assert(static_cast<int>(std::errc::resource_unavailable_try_again) == EAGAIN, "");
+ static_assert(static_cast<int>(std::errc::result_out_of_range) == ERANGE, "");
+ static_assert(static_cast<int>(std::errc::state_not_recoverable) == ENOTRECOVERABLE, "");
#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
- static_assert(std::errc::stream_timeout == ETIME, "");
+ static_assert(static_cast<int>(std::errc::stream_timeout) == ETIME, "");
#endif
- static_assert(std::errc::text_file_busy == ETXTBSY, "");
- static_assert(std::errc::timed_out == ETIMEDOUT, "");
- static_assert(std::errc::too_many_files_open_in_system == ENFILE, "");
- static_assert(std::errc::too_many_files_open == EMFILE, "");
- static_assert(std::errc::too_many_links == EMLINK, "");
- static_assert(std::errc::too_many_symbolic_link_levels == ELOOP, "");
- static_assert(std::errc::value_too_large == EOVERFLOW, "");
- static_assert(std::errc::wrong_protocol_type == EPROTOTYPE, "");
+ static_assert(static_cast<int>(std::errc::text_file_busy) == ETXTBSY, "");
+ static_assert(static_cast<int>(std::errc::timed_out) == ETIMEDOUT, "");
+ static_assert(static_cast<int>(std::errc::too_many_files_open_in_system) == ENFILE, "");
+ static_assert(static_cast<int>(std::errc::too_many_files_open) == EMFILE, "");
+ static_assert(static_cast<int>(std::errc::too_many_links) == EMLINK, "");
+ static_assert(static_cast<int>(std::errc::too_many_symbolic_link_levels) == ELOOP, "");
+ static_assert(static_cast<int>(std::errc::value_too_large) == EOVERFLOW, "");
+ static_assert(static_cast<int>(std::errc::wrong_protocol_type) == EPROTOTYPE, "");
}
Modified: libcxx/trunk/test/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp?rev=145698&r1=145697&r2=145698&view=diff
==============================================================================
--- libcxx/trunk/test/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp (original)
+++ libcxx/trunk/test/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp Fri Dec 2 13:36:40 2011
@@ -19,7 +19,7 @@
int main()
{
const std::error_category& e_cat = std::generic_category();
- std::error_condition e_cond = e_cat.default_error_condition(std::errc::not_a_directory);
+ std::error_condition e_cond = e_cat.default_error_condition(static_cast<int>(std::errc::not_a_directory));
assert(e_cond.category() == e_cat);
- assert(e_cond.value() == std::errc::not_a_directory);
+ assert(e_cond.value() == static_cast<int>(std::errc::not_a_directory));
}
Modified: libcxx/trunk/test/thread/futures/futures.errors/default_error_condition.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/futures/futures.errors/default_error_condition.pass.cpp?rev=145698&r1=145697&r2=145698&view=diff
==============================================================================
--- libcxx/trunk/test/thread/futures/futures.errors/default_error_condition.pass.cpp (original)
+++ libcxx/trunk/test/thread/futures/futures.errors/default_error_condition.pass.cpp Fri Dec 2 13:36:40 2011
@@ -19,7 +19,7 @@
int main()
{
const std::error_category& e_cat = std::future_category();
- std::error_condition e_cond = e_cat.default_error_condition(std::errc::not_a_directory);
+ std::error_condition e_cond = e_cat.default_error_condition(static_cast<int>(std::errc::not_a_directory));
assert(e_cond.category() == e_cat);
- assert(e_cond.value() == std::errc::not_a_directory);
+ assert(e_cond.value() == static_cast<int>(std::errc::not_a_directory));
}
Modified: libcxx/trunk/test/thread/futures/futures.overview/future_errc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/futures/futures.overview/future_errc.pass.cpp?rev=145698&r1=145697&r2=145698&view=diff
==============================================================================
--- libcxx/trunk/test/thread/futures/futures.overview/future_errc.pass.cpp (original)
+++ libcxx/trunk/test/thread/futures/futures.overview/future_errc.pass.cpp Fri Dec 2 13:36:40 2011
@@ -21,8 +21,8 @@
int main()
{
- static_assert(std::future_errc::broken_promise == 0, "");
- static_assert(std::future_errc::future_already_retrieved == 1, "");
- static_assert(std::future_errc::promise_already_satisfied == 2, "");
- static_assert(std::future_errc::no_state == 3, "");
+ static_assert(static_cast<int>(std::future_errc::broken_promise) == 0, "");
+ static_assert(static_cast<int>(std::future_errc::future_already_retrieved) == 1, "");
+ static_assert(static_cast<int>(std::future_errc::promise_already_satisfied) == 2, "");
+ static_assert(static_cast<int>(std::future_errc::no_state) == 3, "");
}
Modified: libcxx/trunk/test/thread/futures/futures.overview/future_status.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/futures/futures.overview/future_status.pass.cpp?rev=145698&r1=145697&r2=145698&view=diff
==============================================================================
--- libcxx/trunk/test/thread/futures/futures.overview/future_status.pass.cpp (original)
+++ libcxx/trunk/test/thread/futures/futures.overview/future_status.pass.cpp Fri Dec 2 13:36:40 2011
@@ -20,7 +20,7 @@
int main()
{
- static_assert(std::future_status::ready == 0, "");
- static_assert(std::future_status::timeout == 1, "");
- static_assert(std::future_status::deferred == 2, "");
+ static_assert(static_cast<int>(std::future_status::ready) == 0, "");
+ static_assert(static_cast<int>(std::future_status::timeout) == 1, "");
+ static_assert(static_cast<int>(std::future_status::deferred) == 2, "");
}
Modified: libcxx/trunk/test/thread/futures/futures.overview/launch.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/thread/futures/futures.overview/launch.pass.cpp?rev=145698&r1=145697&r2=145698&view=diff
==============================================================================
--- libcxx/trunk/test/thread/futures/futures.overview/launch.pass.cpp (original)
+++ libcxx/trunk/test/thread/futures/futures.overview/launch.pass.cpp Fri Dec 2 13:36:40 2011
@@ -20,7 +20,8 @@
int main()
{
- static_assert(std::launch::any == (std::launch::async | std::launch::deferred), "");
- static_assert(std::launch::async == 1, "");
- static_assert(std::launch::deferred == 2, "");
+ static_assert(static_cast<int>(std::launch::any) ==
+ (static_cast<int>(std::launch::async) | static_cast<int>(std::launch::deferred)), "");
+ static_assert(static_cast<int>(std::launch::async) == 1, "");
+ static_assert(static_cast<int>(std::launch::deferred) == 2, "");
}
More information about the cfe-commits
mailing list