// (C) Copyright John Maddock 2001. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/config for most recent version. // MACRO: BOOST_NO_INCLASS_MEMBER_INITIALIZATION // TITLE: inline member constant initialisation // DESCRIPTION: Compiler violates std::9.4.2/4. namespace boost_no_inclass_member_initialization{ struct UDT{}; template struct ice_or_helper { static const bool value = true; }; template <> struct ice_or_helper { static const bool value = false; }; template struct ice_or { static const bool value = ice_or_helper::value; }; template struct is_int { static const bool value = false; }; template <> struct is_int { static const bool value = true; }; #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))) # define BOOST_UNUSED_ATTRIBUTE __attribute__((unused)) #else # define BOOST_UNUSED_ATTRIBUTE #endif int test() { typedef int a1[ice_or< is_int::value, is_int::value>::value ? 1 : -1] BOOST_UNUSED_ATTRIBUTE; return 0; } } #undef BOOST_UNUSED_ATTRIBUTE