Opened 12 years ago
Closed 12 years ago
#5271 closed Bugs (fixed)
is_convertible with 16-byte aligned types causes errors on MSVC
Reported by: | Mathias Gaunard | Owned by: | John Maddock |
---|---|---|---|
Milestone: | To Be Determined | Component: | type_traits |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | is_convertible msvc alignment | Cc: |
Description
This appears to be caused by passing those types by value to functions, as is done by "...". MSVC doesn't allow types with alignment higher than that of the stack to be passed by value to functions.
The fix would involve forcing everything to be references somehow.
Testcase:
#include <boost/type_traits/is_convertible.hpp> struct A { __declspec(align(16)) int value; }; struct B { }; typedef boost::is_convertible<A, B>::type C;
Change History (2)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
It doesn't really seem fixable within the field of portable C++03, so I see three solutions:
__is_convertible_to
built-in on MSVC (available since 7.1)Solution number 2 seems to be the easiest one for a quick fix, and the one most MSVC versions will be able to benefit from.