]> granicus.if.org Git - clang/commitdiff
Make sure that we recognize __attribute__((align)) as a synonym for
authorDouglas Gregor <dgregor@apple.com>
Fri, 11 May 2012 23:01:43 +0000 (23:01 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 11 May 2012 23:01:43 +0000 (23:01 +0000)
__attribute__((aligned)). Fixes <rdar://problem/11435441>, a
regression I introduced in r156003. This is the narrow fix; a more
comprehensive fix is coming.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156657 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclAttr.cpp
test/Sema/attr-aligned.c

index 93516501aacef6e3db4b36b228e2c917f8f81c6e..284a72e3399ba9971f770b1e560dab69c4ac9f4e 100644 (file)
@@ -3792,6 +3792,7 @@ static void ProcessInheritableDeclAttr(Sema &S, Scope *scope, Decl *D,
     // by ProcessNonInheritableDeclAttr.
     break;
   case AttributeList::AT_alias:       handleAliasAttr       (S, D, Attr); break;
+  case AttributeList::AT_align:
   case AttributeList::AT_aligned:     handleAlignedAttr     (S, D, Attr); break;
   case AttributeList::AT_always_inline:
     handleAlwaysInlineAttr  (S, D, Attr); break;
index c094ff172dd59cfd3fddb9c1cadef7236d6b0b5e..92f2742d2f2234bd645da691029b20155a735d66 100644 (file)
@@ -32,7 +32,7 @@ struct D { int member __attribute__((aligned(2))) __attribute__((packed)); } d;
 char d1[__alignof__(d) == 2 ?: -1] = {0};
 char d2[__alignof__(d.member) == 2 ?: -1] = {0};
 
-struct E { int member __attribute__((aligned(2))); } __attribute__((packed));
+struct E { int member __attribute__((align(2))); } __attribute__((packed));
 struct E e;
 char e1[__alignof__(e) == 2 ?: -1] = {0};
 char e2[__alignof__(e.member) == 2 ?: -1] = {0};