Support __attribute__((packed)) (along with other attributes) at the
end of a struct/class/union in C++, from Justin Bogner!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99811 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/struct-packed-align.c b/test/Sema/struct-packed-align.c
index 60a9feb..2b94567 100644
--- a/test/Sema/struct-packed-align.c
+++ b/test/Sema/struct-packed-align.c
@@ -37,6 +37,14 @@
 extern int d1[sizeof(struct packed_fas) == 1 ? 1 : -1];
 extern int d2[__alignof(struct packed_fas) == 1 ? 1 : -1];
 
+struct packed_after_fas {
+    char a;
+    int b[];
+} __attribute__((packed));
+
+extern int d1_2[sizeof(struct packed_after_fas) == 1 ? 1 : -1];
+extern int d2_2[__alignof(struct packed_after_fas) == 1 ? 1 : -1];
+
 // Alignment
 
 struct __attribute__((aligned(8))) as1 {
diff --git a/test/SemaCXX/class-layout.cpp b/test/SemaCXX/class-layout.cpp
index 2b8d1d3..f3c75f4 100644
--- a/test/SemaCXX/class-layout.cpp
+++ b/test/SemaCXX/class-layout.cpp
@@ -48,6 +48,13 @@
 
 SA(6, sizeof(H) == 1);
 
+struct I {
+  char b;
+  int a;
+} __attribute__((packed));
+
+SA(6_1, sizeof(I) == 5);
+
 // PR5580
 namespace PR5580 {