From d215ee5c9ceb89c9032e802e4400ee77f7397ffe Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 30 Sep 2013 00:20:43 +0000 Subject: [PATCH 1/4] StaticAssert: Remove obsolete MSVC version check. [SVN r86035] --- include/boost/static_assert.hpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/include/boost/static_assert.hpp b/include/boost/static_assert.hpp index d083a9c..10bb357 100644 --- a/include/boost/static_assert.hpp +++ b/include/boost/static_assert.hpp @@ -117,14 +117,7 @@ template struct static_assert_test{}; // #if !defined(BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS) -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) -// __LINE__ macro broken when -ZI is used see Q199057 -// fortunately MSVC ignores duplicate typedef's. -#define BOOST_STATIC_ASSERT( B ) \ - typedef ::boost::static_assert_test<\ - sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)\ - > boost_static_assert_typedef_ -#elif defined(BOOST_MSVC) && defined(BOOST_NO_CXX11_VARIADIC_MACROS) +#if defined(BOOST_MSVC) && defined(BOOST_NO_CXX11_VARIADIC_MACROS) #define BOOST_STATIC_ASSERT( B ) \ typedef ::boost::static_assert_test<\ sizeof(::boost::STATIC_ASSERTION_FAILURE< BOOST_STATIC_ASSERT_BOOL_CAST ( B ) >)>\ From 4aab0b78c3ddcbefa9351669d776dd2f831074b5 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 11 Dec 2013 18:57:43 +0000 Subject: [PATCH 2/4] If we have a static_assert we should use it, even if there are no variadic macros. --- include/boost/static_assert.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/static_assert.hpp b/include/boost/static_assert.hpp index 10bb357..2d3ab04 100644 --- a/include/boost/static_assert.hpp +++ b/include/boost/static_assert.hpp @@ -30,7 +30,7 @@ # ifndef BOOST_NO_CXX11_VARIADIC_MACROS # define BOOST_STATIC_ASSERT_MSG( ... ) static_assert(__VA_ARGS__) # else -# define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B ) +# define BOOST_STATIC_ASSERT_MSG( B, Msg ) static_assert( B, Msg ) # endif #else # define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B ) From d2f57474a7427cafe5d7621b2117560f43d4d852 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 18 Aug 2014 15:11:03 +0100 Subject: [PATCH 3/4] Add metadata file. --- meta/libraries.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 meta/libraries.json diff --git a/meta/libraries.json b/meta/libraries.json new file mode 100644 index 0000000..6d0bd32 --- /dev/null +++ b/meta/libraries.json @@ -0,0 +1,16 @@ +{ + "key": "static_assert", + "name": "Static Assert", + "authors": [ + "John Maddock" + ], + "description": "Static assertions (compile time assertions).", + "category": [ + "Correctness", + "Generic", + "Metaprogramming" + ], + "maintainers": [ + "John Maddock " + ] +} From 15c38db1d2844527aa7436ec43079d624f2f595d Mon Sep 17 00:00:00 2001 From: Mathias Gaunard Date: Mon, 29 Sep 2014 14:55:39 +0200 Subject: [PATCH 4/4] enable __attribute__((unused)) to avoid unused typedef warnings with all gcc-like variants starting with gcc 4.0. Avoids generating the warning with Clang among others. --- include/boost/static_assert.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/static_assert.hpp b/include/boost/static_assert.hpp index 2d3ab04..8dfddae 100644 --- a/include/boost/static_assert.hpp +++ b/include/boost/static_assert.hpp @@ -67,7 +67,7 @@ // // If the compiler warns about unused typedefs then enable this: // -#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))) +#if defined(__GNUC__) && (__GNUC__ >= 4) # define BOOST_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused)) #else # define BOOST_STATIC_ASSERT_UNUSED_ATTRIBUTE