From c8bd860de6d68e9301b23581a9ccf4e22f12fd72 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 26 Sep 2013 13:02:51 +0000 Subject: [PATCH 1/8] Remove obsolete MSVC check from pragma guard git grep -h -B1 "^#\s*pragma once" | grep -v pragma | sort | uniq is now clean. [SVN r85952] --- include/boost/detail/basic_pointerbuf.hpp | 2 +- include/boost/lexical_cast.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/basic_pointerbuf.hpp b/include/boost/detail/basic_pointerbuf.hpp index 81ebfe7..8b56cbe 100644 --- a/include/boost/detail/basic_pointerbuf.hpp +++ b/include/boost/detail/basic_pointerbuf.hpp @@ -14,7 +14,7 @@ #define BOOST_DETAIL_BASIC_POINTERBUF_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif diff --git a/include/boost/lexical_cast.hpp b/include/boost/lexical_cast.hpp index c3cf818..3c0f230 100644 --- a/include/boost/lexical_cast.hpp +++ b/include/boost/lexical_cast.hpp @@ -3,7 +3,7 @@ // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif From 8a49514506eeda54efe33f41251fcda3e58d65a7 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 30 Sep 2013 00:18:40 +0000 Subject: [PATCH 2/8] cast: Remove obsolete MSVC version check. [SVN r86026] --- include/boost/cast.hpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/include/boost/cast.hpp b/include/boost/cast.hpp index 2615d18..0018924 100644 --- a/include/boost/cast.hpp +++ b/include/boost/cast.hpp @@ -50,17 +50,6 @@ # include # include -// It has been demonstrated numerous times that MSVC 6.0 fails silently at link -// time if you use a template function which has template parameters that don't -// appear in the function's argument list. -// -// TODO: Add this to config.hpp? -# if defined(BOOST_MSVC) && BOOST_MSVC < 1300 -# define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::type* = 0 -# else -# define BOOST_EXPLICIT_DEFAULT_TARGET -# endif - namespace boost { // See the documentation for descriptions of how to choose between @@ -73,7 +62,7 @@ namespace boost // section 15.8 exercise 1, page 425. template - inline Target polymorphic_cast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET) + inline Target polymorphic_cast(Source* x) { Target tmp = dynamic_cast(x); if ( tmp == 0 ) throw std::bad_cast(); @@ -92,14 +81,12 @@ namespace boost // Contributed by Dave Abrahams template - inline Target polymorphic_downcast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET) + inline Target polymorphic_downcast(Source* x) { BOOST_ASSERT( dynamic_cast(x) == x ); // detect logic error return static_cast(x); } -# undef BOOST_EXPLICIT_DEFAULT_TARGET - } // namespace boost # include From 13f14db751bf00331ca861fda506640056273a16 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 1 Oct 2013 08:47:00 +0000 Subject: [PATCH 3/8] lexical_cast: Remove obsolete GCC version check. [SVN r86113] --- include/boost/lexical_cast.hpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/include/boost/lexical_cast.hpp b/include/boost/lexical_cast.hpp index 3c0f230..e7913ab 100644 --- a/include/boost/lexical_cast.hpp +++ b/include/boost/lexical_cast.hpp @@ -2395,16 +2395,7 @@ namespace boost { { return !is_pointer::value && stream >> output && - stream.get() == -#if defined(__GNUC__) && (__GNUC__<3) && defined(BOOST_NO_STD_WSTRING) -// GCC 2.9x lacks std::char_traits<>::eof(). -// We use BOOST_NO_STD_WSTRING to filter out STLport and libstdc++-v3 -// configurations, which do provide std::char_traits<>::eof(). - - EOF; -#else - traits_type::eof(); -#endif + stream.get() == traits_type::eof(); } bool operator>>(std::string &output) From 472ebeff30aa1a7b78474b9f6dcf3d3ca05e8ca4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 11 Oct 2013 23:20:59 +0000 Subject: [PATCH 4/8] Simplify multi-component ifdefs containing BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION [SVN r86248] --- include/boost/lexical_cast.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/lexical_cast.hpp b/include/boost/lexical_cast.hpp index e7913ab..9fd144f 100644 --- a/include/boost/lexical_cast.hpp +++ b/include/boost/lexical_cast.hpp @@ -135,7 +135,7 @@ namespace boost } } // namespace boost -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__SUNPRO_CC) && !defined(__PGIC__) +#if !defined(__SUNPRO_CC) && !defined(__PGIC__) #include #include @@ -2322,7 +2322,7 @@ namespace boost { } // namespace boost -#else // #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#else namespace boost { namespace detail From 524232ebabd90181bad9bcd98d7a03da2954e799 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Sun, 20 Oct 2013 17:57:15 +0000 Subject: [PATCH 5/8] Supressing MSVC2013 warnings and ensuring that lexical cast io classes are not copied (refs #9271) [SVN r86374] --- include/boost/lexical_cast.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/boost/lexical_cast.hpp b/include/boost/lexical_cast.hpp index 9fd144f..c954310 100644 --- a/include/boost/lexical_cast.hpp +++ b/include/boost/lexical_cast.hpp @@ -159,6 +159,7 @@ namespace boost #include #include #include +#include #ifndef BOOST_NO_CWCHAR # include #endif @@ -642,7 +643,7 @@ namespace boost { namespace detail // lcast_put_unsigned { template - class lcast_put_unsigned { + class lcast_put_unsigned: boost::noncopyable { typedef BOOST_DEDUCED_TYPENAME Traits::int_type int_type; BOOST_DEDUCED_TYPENAME boost::mpl::if_c< (sizeof(int_type) > sizeof(T)) @@ -729,7 +730,7 @@ namespace boost { namespace detail // lcast_ret_unsigned { template - class lcast_ret_unsigned { + class lcast_ret_unsigned: boost::noncopyable { bool m_multiplier_overflowed; T m_multiplier; T& m_value; @@ -1310,7 +1311,7 @@ namespace boost { , bool RequiresStringbuffer , std::size_t CharacterBufferSize > - class lexical_istream_limited_src { + class lexical_istream_limited_src: boost::noncopyable { typedef BOOST_DEDUCED_TYPENAME out_stream_helper_trait::buffer_t buffer_t; @@ -1676,7 +1677,7 @@ namespace boost { template - class lexical_ostream_limited_src { + class lexical_ostream_limited_src: boost::noncopyable { //`[start, finish)` is the range to output by `operator >>` const CharT* start; const CharT* const finish; From 39d1abe7548bf27ea6bc747bfdec1a6d29ba5247 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Mon, 21 Oct 2013 06:46:01 +0000 Subject: [PATCH 6/8] Suppress some of the Level 4 MSVC warnings in the basic_pointerbuf.hpp (refs #9271) [SVN r86377] --- include/boost/detail/basic_pointerbuf.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/boost/detail/basic_pointerbuf.hpp b/include/boost/detail/basic_pointerbuf.hpp index 8b56cbe..6d7893b 100644 --- a/include/boost/detail/basic_pointerbuf.hpp +++ b/include/boost/detail/basic_pointerbuf.hpp @@ -23,6 +23,11 @@ namespace boost { namespace detail { +#ifdef BOOST_MSVC +// VC mistakenly assumes that `setbuf` and other functions are not referenced. +#pragma warning(disable: 4505) //Unreferenced local function has been removed +#endif + // // class basic_pointerbuf: // acts as a stream buffer which wraps around a pair of pointers: @@ -129,6 +134,9 @@ basic_pointerbuf::seekpos(pos_type sp, ::std::ios_base::openmode return pos_type(off_type(-1)); } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif }} // namespace boost::detail From d78d334dbbab3b623cc1c4a6f65284af05ada0d4 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Mon, 21 Oct 2013 09:21:35 +0000 Subject: [PATCH 7/8] Add missing #pragma wraning(push) (refs #9271) [SVN r86378] --- include/boost/detail/basic_pointerbuf.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/detail/basic_pointerbuf.hpp b/include/boost/detail/basic_pointerbuf.hpp index 6d7893b..f2360ae 100644 --- a/include/boost/detail/basic_pointerbuf.hpp +++ b/include/boost/detail/basic_pointerbuf.hpp @@ -24,6 +24,7 @@ namespace boost { namespace detail { #ifdef BOOST_MSVC +#pragma warning(push) // VC mistakenly assumes that `setbuf` and other functions are not referenced. #pragma warning(disable: 4505) //Unreferenced local function has been removed #endif From edde5f442e0d982348ceb71e215efb2afbad6823 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Tue, 22 Oct 2013 09:07:02 +0000 Subject: [PATCH 8/8] Another attempt to suppress MSVC warnings (refs #9271) [SVN r86388] --- include/boost/detail/basic_pointerbuf.hpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/include/boost/detail/basic_pointerbuf.hpp b/include/boost/detail/basic_pointerbuf.hpp index f2360ae..1d8cf37 100644 --- a/include/boost/detail/basic_pointerbuf.hpp +++ b/include/boost/detail/basic_pointerbuf.hpp @@ -23,12 +23,6 @@ namespace boost { namespace detail { -#ifdef BOOST_MSVC -#pragma warning(push) -// VC mistakenly assumes that `setbuf` and other functions are not referenced. -#pragma warning(disable: 4505) //Unreferenced local function has been removed -#endif - // // class basic_pointerbuf: // acts as a stream buffer which wraps around a pair of pointers: @@ -57,9 +51,13 @@ public: #endif protected: - base_type* setbuf(char_type* s, streamsize n); - typename this_type::pos_type seekpos(pos_type sp, ::std::ios_base::openmode which); - typename this_type::pos_type seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which); + // VC mistakenly assumes that `setbuf` and other functions are not referenced. + // Marking those functions with `inline` suppresses the warnings. + // There must be no harm from marking virtual functions as inline: inline virtual + // call can be inlined ONLY when the compiler knows the "exact class". + inline base_type* setbuf(char_type* s, streamsize n); + inline typename this_type::pos_type seekpos(pos_type sp, ::std::ios_base::openmode which); + inline typename this_type::pos_type seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which); private: basic_pointerbuf& operator=(const basic_pointerbuf&); @@ -135,10 +133,6 @@ basic_pointerbuf::seekpos(pos_type sp, ::std::ios_base::openmode return pos_type(off_type(-1)); } -#ifdef BOOST_MSVC -#pragma warning(pop) -#endif - }} // namespace boost::detail #endif // BOOST_DETAIL_BASIC_POINTERBUF_HPP