id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 2409,boost::optional (boost-1.36.0) fails to compile on MSVS 9.0 with struct member alignment being set to 1 byte,slava@…,Fernando Cacciola,"When I try to compile the following code with MSVS 9.0 and boost-1.36.0 with struct member alignment being set to 1 or 2 bytes, it fails with boost::STATIC_ASSERTION_FAILURE: {{{ #include boost::optional test_func(int i) { if(i) return boost::optional(1234); else return boost::optional(); } 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' 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' 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' 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::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' 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' 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' 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' 1> with 1> [ 1> x=false 1> ] }}} Setting struct member alignment to 4 or more bytes solves the problem. The same code compiles well with any alignment value with boost-1.35.",Bugs,closed,Boost 1.37.0,optional,Boost 1.36.0,Regression,fixed,,