From 29975d61928bb4ca368dfc65cac4055bbcd6ffba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Krzemie=C5=84ski?= Date: Tue, 13 Oct 2015 10:47:26 +0200 Subject: [PATCH] Config: improved NO_PROPER_CONVERT --- .../boost/optional/detail/optional_config.hpp | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/include/boost/optional/detail/optional_config.hpp b/include/boost/optional/detail/optional_config.hpp index bab9236..45caff9 100644 --- a/include/boost/optional/detail/optional_config.hpp +++ b/include/boost/optional/detail/optional_config.hpp @@ -60,12 +60,26 @@ #endif #if defined(__GNUC__) -# if (__GNUC__ == 5 && __GNUC_MINOR__ <= 2) || (__GNUC__ == 6 && __GNUC_MINOR__ < 1) -// On GCC 5.1, 5.2 and 6.0 an unwanted temporary is created when you copy-initialize +// On some GCC versions an unwanted temporary is created when you copy-initialize // from a const lvalue of integral type. Thus we bind not to the original address but // to a temporary. + +# if (__GNUC__ == 4 && __GNUC_MINOR__ == 4) # define BOOST_OPTIONAL_CONFIG_NO_PROPER_CONVERT_FROM_CONST_INT # endif -#endif + +# if (__GNUC__ == 4 && __GNUC_MINOR__ == 5) +# define BOOST_OPTIONAL_CONFIG_NO_PROPER_CONVERT_FROM_CONST_INT +# endif + +# if (__GNUC__ == 5 && __GNUC_MINOR__ < 2) +# define BOOST_OPTIONAL_CONFIG_NO_PROPER_CONVERT_FROM_CONST_INT +# endif + +# if (__GNUC__ == 5 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 0) +# define BOOST_OPTIONAL_CONFIG_NO_PROPER_CONVERT_FROM_CONST_INT +# endif + +#endif // defined(__GNUC__) #endif // header guard