From: Kevin Lin on
The following source was compiled using VS.NET 2003:

template <size_t i> struct test_align1
{
__declspec(align(16)) struct {} align;
};

struct test_align2
{
__declspec(align(16)) struct {} align;
};

void funcme(test_align1<0> align) {}
void funcme2(test_align2 align) {}

funcme2 generates an error (formal parameter with __declspec(16)) won't
be aligned) while funcme does not. Is that a compiler bug?

From: doug mansell on
Kevin Lin wrote:
> The following source was compiled using VS.NET 2003:
>
> template <size_t i> struct test_align1
> {
> __declspec(align(16)) struct {} align;
> };
>
> struct test_align2
> {
> __declspec(align(16)) struct {} align;
> };
>
> void funcme(test_align1<0> align) {}
> void funcme2(test_align2 align) {}
>
> funcme2 generates an error (formal parameter with __declspec(16)) won't
> be aligned) while funcme does not. Is that a compiler bug?
>

I'd say that the fact that it doesn't generate an error for funcme is a bug.

doug.


 | 
Pages: 1
Prev: MAC address
Next: GetFileVersionInfo example