Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#8644 closed Bugs (fixed)

Regression in alternative enum based implementation

Reported by: Kohei Takahashi <flast@…> Owned by: John Maddock
Milestone: Boost 1.54.0 Component: static_assert
Version: Boost Release Branch Severity: Regression
Keywords: Cc:

Description

It seems to be wrong definition of alternative enum based implementation, which is introduced at [82886].

After [82886]:

#else
// alternative enum based implementation:
#  ifndef BOOST_NO_CXX11_VARIADIC_MACROS
#    define BOOST_STATIC_ASSERT( ... ) \
         enum { BOOST_JOIN(boost_static_assert_enum_, __LINE__) \
            = sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( __VA_ARGS__ ) >) }
#  else
         enum { BOOST_JOIN(boost_static_assert_enum_, __LINE__) \
            = sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >) }
#  endif
#endif
#endif // defined(BOOST_NO_CXX11_STATIC_ASSERT)

But should be this:

 #else
 // alternative enum based implementation:
 #  ifndef BOOST_NO_CXX11_VARIADIC_MACROS
 #    define BOOST_STATIC_ASSERT( ... ) \
          enum { BOOST_JOIN(boost_static_assert_enum_, __LINE__) \
             = sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( __VA_ARGS__ ) >) }
 #  else
+#    define BOOST_STATIC_ASSERT( B ) \
          enum { BOOST_JOIN(boost_static_assert_enum_, __LINE__) \
             = sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >) }
 #  endif
 #endif
 #endif // defined(BOOST_NO_CXX11_STATIC_ASSERT)

This bug affects 1.54 release branch.

Change History (3)

comment:1 by John Maddock, 9 years ago

(In [84686]) Apply patch from #8644. Refs #8644.

comment:2 by John Maddock, 9 years ago

Resolution: fixed
Status: newclosed

(In [84713]) Apply patch from 8644. Fixes #8644.

comment:3 by John Maddock, 9 years ago

(In [84858]) Merge static_assert fix from Trunk. Fixes #8644.

Note: See TracTickets for help on using tickets.