Program is below:

#include <list>

#pragma pack(1)
struct A
{
    unsigned short m1;
    std::list<int> m2; //generate a instantiation type, the alignment is 1
};

#pragma pack()

struct B
{
    unsigned short m1;
    std::list<int> m2; //use above instantiation type, alignment  is 1, it
don't 4 or 8.
};

is this a bug?

Regard!


-- 
           Summary: alignment and template
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zhq at huawei dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34614

Reply via email to