http://llvm.org/bugs/show_bug.cgi?id=7102

           Summary: Clang fails to pack template containing packed union
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


dhcp-172-31-154-126:~/src/llvm/clang/obj$ cat ~/tmp/test.cc
#include <stdio.h>
class NotTpl {
public:
    union {
        char space[11];
        void* ptr;
    }  __attribute__((packed));
};
template<size_t N>
class Tpl {
public:
    union {
        char space[N];
        void* ptr;
    }  __attribute__((packed));
};
int main() {
    printf("%zd\n", sizeof(NotTpl));
    printf("%zd\n", sizeof(Tpl<11>));
}
dhcp-172-31-154-126:~/src/llvm/clang/obj$ g++  ~/tmp/test.cc && ./a.out
11
11
dhcp-172-31-154-126:~/src/llvm/clang/obj$ Debug/bin/clang++  ~/tmp/test.cc &&
./a.out
11
12
dhcp-172-31-154-126:~/src/llvm/clang/obj$

-- 
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

Reply via email to