Skip to content

Commit d345147

Browse files
committed
Annotate deprecated items with [[deprecated]]
1 parent ed6aa8a commit d345147

File tree

11 files changed

+33
-8
lines changed

11 files changed

+33
-8
lines changed

asio/include/asio/basic_deadline_timer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ namespace asio {
129129
template <typename Time,
130130
typename TimeTraits = asio::time_traits<Time>,
131131
typename Executor = any_io_executor>
132-
class basic_deadline_timer
132+
class ASIO_DEPRECATED_X("Use basic_waitable_timer") basic_deadline_timer
133133
{
134134
private:
135135
class initiate_async_wait;

asio/include/asio/basic_io_object.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace detail
3030
{
3131
// Type trait used to determine whether a service supports move.
3232
template <typename IoObjectService>
33-
class service_has_move
33+
class ASIO_DEPRECATED service_has_move
3434
{
3535
private:
3636
typedef IoObjectService service_type;
@@ -60,7 +60,7 @@ template <typename IoObjectService>
6060
template <typename IoObjectService,
6161
bool Movable = detail::service_has_move<IoObjectService>::value>
6262
#endif
63-
class basic_io_object
63+
class ASIO_DEPRECATED basic_io_object
6464
{
6565
public:
6666
/// The type of the service that will be used to provide I/O operations.
@@ -190,7 +190,7 @@ class basic_io_object
190190

191191
// Specialisation for movable objects.
192192
template <typename IoObjectService>
193-
class basic_io_object<IoObjectService, true>
193+
class ASIO_DEPRECATED basic_io_object<IoObjectService, true>
194194
{
195195
public:
196196
typedef IoObjectService service_type;

asio/include/asio/buffer.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,9 @@ class const_buffer
328328
/// (Deprecated: Use the socket/descriptor wait() and async_wait() member
329329
/// functions.) An implementation of both the ConstBufferSequence and
330330
/// MutableBufferSequence concepts to represent a null buffer sequence.
331-
class null_buffers
331+
class ASIO_DEPRECATED_X(
332+
"Use the socket/descriptor wait() and async_wait() member functions")
333+
null_buffers
332334
{
333335
public:
334336
/// The type for each element in the list of buffers.

asio/include/asio/deadline_timer.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ namespace asio {
3131

3232
/// (Deprecated: Use system_timer.) Typedef for the typical usage of timer. Uses
3333
/// a UTC clock.
34+
ASIO_DEPRECATED_X("Use system_timer")
3435
typedef basic_deadline_timer<boost::posix_time::ptime> deadline_timer;
3536

3637
} // namespace asio

asio/include/asio/detail/config.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,20 @@
13861386
# define ASIO_NODISCARD
13871387
#endif // !defined(ASIO_NODISCARD)
13881388

1389+
// Compiler support for the the [[deprecated(msg)]] attribute.
1390+
#if !defined(ASIO_DEPRECATED)
1391+
# if defined(__has_cpp_attribute)
1392+
# if __has_cpp_attribute(deprecated) && !defined(ASIO_IGNORE_DEPRECATED)
1393+
# define ASIO_DEPRECATED [[deprecated]]
1394+
# define ASIO_DEPRECATED_X(msg) [[deprecated(msg)]]
1395+
# endif // __has_cpp_attribute(deprecated)
1396+
# endif // defined(__has_cpp_attribute)
1397+
#endif // !defined(ASIO_DEPRECATED)
1398+
#if !defined(ASIO_DEPRECATED)
1399+
# define ASIO_DEPRECATED
1400+
# define ASIO_DEPRECATED_X(msg)
1401+
#endif // !defined(ASIO_DEPRECATED)
1402+
13891403
// Kernel support for MSG_NOSIGNAL.
13901404
#if !defined(ASIO_HAS_MSG_NOSIGNAL)
13911405
# if defined(__linux__)

asio/include/asio/detail/push_options.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262

6363
# pragma GCC diagnostic push
6464
# pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
65+
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
6566
# if (__clang_major__ >= 6)
6667
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
6768
# endif // (__clang_major__ >= 6)
@@ -106,6 +107,9 @@
106107
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || (__GNUC__ > 4)
107108
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
108109
# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || (__GNUC__ > 4)
110+
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4)
111+
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
112+
# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || (__GNUC__ > 4)
109113
# if (__GNUC__ >= 7)
110114
# pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
111115
# endif // (__GNUC__ >= 7)
@@ -184,6 +188,7 @@
184188
# pragma warning (disable:4512)
185189
# pragma warning (disable:4610)
186190
# pragma warning (disable:4675)
191+
# pragma warning (disable:4996)
187192
# if (_MSC_VER < 1600)
188193
// Visual Studio 2008 generates spurious warnings about unused parameters.
189194
# pragma warning (disable:4100)

asio/include/asio/detail/timer_queue_ptime.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct forwarding_posix_time_traits : time_traits<boost::posix_time::ptime> {};
3333

3434
// Template specialisation for the commonly used instantiation.
3535
template <>
36-
class timer_queue<time_traits<boost::posix_time::ptime>>
36+
class ASIO_DEPRECATED timer_queue<time_traits<boost::posix_time::ptime>>
3737
: public timer_queue_base
3838
{
3939
public:

asio/include/asio/impl/execution_context.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Service& make_service(execution_context& e, Args&&... args)
4646
}
4747

4848
template <typename Service>
49+
ASIO_DEPRECATED_X("Use make_service()")
4950
inline void add_service(execution_context& e, Service* svc)
5051
{
5152
// Check that Service meets the necessary type requirements.

asio/include/asio/io_context.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ class io_context
459459
* boost::bind(f, a1, ... an)); @endcode
460460
*/
461461
template <typename Handler>
462+
ASIO_DEPRECATED_X("Use asio::bind_executor()")
462463
#if defined(GENERATING_DOCUMENTATION)
463464
unspecified
464465
#else

asio/include/asio/io_context_strand.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ class io_context::strand
236236
* @code asio::dispatch(strand, boost::bind(f, a1, ... an)); @endcode
237237
*/
238238
template <typename Handler>
239+
ASIO_DEPRECATED_X("Use asio::bind_executor()")
239240
#if defined(GENERATING_DOCUMENTATION)
240241
unspecified
241242
#else

0 commit comments

Comments
 (0)