Re: [Boost-bugs] [Boost C++ Libraries] #2402: boost::spirit (boost-1.36.0) parsers fail to compile on MSVS 9.0 with struct member alignment being set to 1 byte

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2402: boost::spirit (boost-1.36.0) parsers fail to compile on MSVS 9.0 with struct member alignment being set to 1 byte
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-10-13 08:03:42


#2402: boost::spirit (boost-1.36.0) parsers fail to compile on MSVS 9.0 with
struct member alignment being set to 1 byte
-----------------------------------+----------------------------------------
  Reporter: slava_at_[hidden] | Owner: djowel
      Type: Bugs | Status: new
 Milestone: Boost 1.37.0 | Component: spirit
   Version: Boost 1.36.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------+----------------------------------------

Comment(by slava_at_[hidden]):

 Yes, it appears to be a problem with boost::optional. The following simple
 test fails if compiled with struct member alignment=1 or 2 bytes, and
 everything is OK when alignment is set to 4 or more bytes:

 {{{
 #include <boost/optional.hpp>

 boost::optional<int> test_func(int i) {
         if(i) return boost::optional<int>(1234);
         else return boost::optional<int>();
 }


 int main(int argc, char* argv[])
 {
         test_func(1);
         return 0;
 }
 }}}

 The errors are:
 {{{
 d:\users\slava\etap\external\boost\boost\type_traits\type_with_alignment.hpp(206)
 : error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'
 1> with
 1> [
 1> x=false
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\type_traits\type_with_alignment.hpp(218)
 : see reference to class template instantiation
 'boost::detail::type_with_alignment_imp<Align>' being compiled
 1> with
 1> [
 1> Align=4
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\optional\optional.hpp(112) : see
 reference to class template instantiation
 'boost::type_with_alignment<Align>' being compiled
 1> with
 1> [
 1> Align=4
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\optional\optional.hpp(113) : see
 reference to class template instantiation
 'boost::optional_detail::aligned_storage<T>::dummy_u' being compiled
 1> with
 1> [
 1> T=int
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\optional\optional.hpp(448) : see
 reference to class template instantiation
 'boost::optional_detail::aligned_storage<T>' being compiled
 1> with
 1> [
 1> T=int
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\optional\optional.hpp(455) : see
 reference to class template instantiation
 'boost::optional_detail::optional_base<T>' being compiled
 1> with
 1> [
 1> T=int
 1> ]
 1> d:\users\slava\test\test.cpp(8) : see reference to class
 template instantiation 'boost::optional<T>' being compiled
 1> with
 1> [
 1> T=int
 1> ]
 1>d:\users\slava\etap\external\boost\boost\type_traits\type_with_alignment.hpp(207)
 : error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'
 1> with
 1> [
 1> x=false
 1> ]
 }}}

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2402#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:58 UTC