http://llvm.org/bugs/show_bug.cgi?id=10819
Summary: #pragma pack for template structs ignored
Product: clang
Version: 2.9
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
#pragma pack ignored for template structures. Tested on clang 2.9 on mac and
win32. Code:
#include <cstdio>
#pragma pack(1)
struct A
{
int a;
char b;
int c;
};
template <class T>
struct B
{
T a;
char b;
T c;
};
int main ()
{
printf ("sizeof A = %u\n", sizeof (A));
printf ("sizeof B<int> = %u\n", sizeof (B<int>));
return 0;
}
Prints:
sizeof A = 9
sizeof B<int> = 12
Should print:
sizeof A = 9
sizeof B<int> = 9
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs