Skip to content

Commit 4f362c7

Browse files
committed
Make sure that we recognize __attribute__((align)) as a synonym for
__attribute__((aligned)). Fixes <rdar://problem/11435441>, a regression I introduced in r156003. This is the narrow fix; a more comprehensive fix is coming. llvm-svn: 156657
1 parent 5d60c36 commit 4f362c7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3792,6 +3792,7 @@ static void ProcessInheritableDeclAttr(Sema &S, Scope *scope, Decl *D,
37923792
// by ProcessNonInheritableDeclAttr.
37933793
break;
37943794
case AttributeList::AT_alias: handleAliasAttr (S, D, Attr); break;
3795+
case AttributeList::AT_align:
37953796
case AttributeList::AT_aligned: handleAlignedAttr (S, D, Attr); break;
37963797
case AttributeList::AT_always_inline:
37973798
handleAlwaysInlineAttr (S, D, Attr); break;

clang/test/Sema/attr-aligned.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct D { int member __attribute__((aligned(2))) __attribute__((packed)); } d;
3232
char d1[__alignof__(d) == 2 ?: -1] = {0};
3333
char d2[__alignof__(d.member) == 2 ?: -1] = {0};
3434

35-
struct E { int member __attribute__((aligned(2))); } __attribute__((packed));
35+
struct E { int member __attribute__((align(2))); } __attribute__((packed));
3636
struct E e;
3737
char e1[__alignof__(e) == 2 ?: -1] = {0};
3838
char e2[__alignof__(e.member) == 2 ?: -1] = {0};

0 commit comments

Comments
 (0)