This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/38611] New: [4.2/4.3/4.4 Regression] alignof is broken for user aligned types in templates
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Dec 2008 14:50:08 -0000
- Subject: [Bug c++/38611] New: [4.2/4.3/4.4 Regression] alignof is broken for user aligned types in templates
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Take:
typedef struct MyStruct {
unsigned char skip[272];
} MyStruct __attribute__((aligned(128)));
template<typename T>
int GetAlignOf()
{
int a[ __alignof__(T) != __alignof__(MyStruct) ? -1 : 1];
return __alignof__(T);
};
int main()
{
int al1 = GetAlignOf<MyStruct>();
int al2 = __alignof__(MyStruct);
return al1 - al2;
}
--- CUT ---
This should compile and execute without any errors and should return 0.
--
Summary: [4.2/4.3/4.4 Regression] alignof is broken for user
aligned types in templates
Product: gcc
Version: 4.3.3
Status: UNCONFIRMED
Keywords: wrong-code
Severity: critical
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38611