boostorg/iostreams

BOOST_DELETED_FUNCTION(...); produces 1683 "extra ‘;’ [-Wpedantic]" warnings.

evoskuil opened this issue · 4 comments

All warnings are from iostreams. From the macro implementation, BOOST_DELETED_FUNCTION should not be terminated.

#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
#   define BOOST_DELETED_FUNCTION(fun) fun = delete;
#else
#   define BOOST_DELETED_FUNCTION(fun) private: fun;
#endif

https://github.com/boostorg/config/blob/develop/include/boost/config/detail/suffix.hpp#L742-L746

mclow commented

Searching for BOOST_DELETED_FUNCTION.+;$, I found:

iostreams/detail/functional.hpp:41:     BOOST_DELETED_FUNCTION(device_close_operation& operator=(const device_close_operation&));
iostreams/detail/functional.hpp:55:     BOOST_DELETED_FUNCTION(filter_close_operation& operator=(const filter_close_operation&));
iostreams/detail/functional.hpp:81:     BOOST_DELETED_FUNCTION(device_close_all_operation& operator=(const device_close_all_operation&));
iostreams/detail/functional.hpp:92:     BOOST_DELETED_FUNCTION(filter_close_all_operation& operator=(const filter_close_all_operation&));
iostreams/detail/functional.hpp:118:     BOOST_DELETED_FUNCTION(member_close_operation& operator=(const member_close_operation&));
iostreams/detail/functional.hpp:136:     BOOST_DELETED_FUNCTION(reset_operation& operator=(const reset_operation&));
iostreams/detail/functional.hpp:152:     BOOST_DELETED_FUNCTION(clear_flags_operation& operator=(const clear_flags_operation&));
iostreams/detail/functional.hpp:176:     BOOST_DELETED_FUNCTION(flush_buffer_operation& operator=(const flush_buffer_operation&));

If you remove those trailing semicolons, do all the warnings from iostreams go away?

mclow commented

One more:

iostreams/detail/adapter/concept_adapter.hpp:121:     BOOST_DELETED_FUNCTION(concept_adapter& operator=(const concept_adapter&));

Yes, 187 each - for a total of 1683.

Thanks @mclow !