Opened 12 years ago

Closed 9 years ago

#5129 closed Bugs (invalid)

Doesn't handle alignment correctly

Reported by: anonymous Owned by: Peter Dimov
Milestone: To Be Determined Component: bind
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:

Description (last modified by viboes)

The following example won't compile on VS 2008 boost v 1.44:

#include "boost/bind.hpp"
#include "xmmintrin.h"

void example( const __m128& )
{}

int main() 
{
	boost::bind( example, __m128() )();
}

The reason being that m128 doesn't have default alignment, causing the following error: "error C2719: 'a1': formal parameter with declspec(align('16')) won't be aligned". The example function in this case would be able to take the argument, the culprit is in the constructor of list1 which takes accepts by value, when in this case we'd need to accept by const reference ( I presume without being familiar with the details of binds implementation ).

Change History (3)

comment:1 by anonymous, 12 years ago

Version: Boost 1.45.0Boost 1.44.0

comment:2 by viboes, 10 years ago

Description: modified (diff)

comment:3 by Peter Dimov, 9 years ago

Resolution: invalid
Status: newclosed

__m128 arguments are generally a nuisance and I'm not sure what we can do about that.

Note: See TracTickets for help on using tickets.