Index: test/Sema/neon-vector-types.c
===================================================================
--- test/Sema/neon-vector-types.c	(revision 122385)
+++ test/Sema/neon-vector-types.c	(working copy)
@@ -26,7 +26,8 @@
 typedef __attribute__((neon_vector_type(4))) void* ptr_elt; // expected-error{{invalid vector element type}}
 typedef __attribute__((neon_polyvector_type(4))) float32_t bad_poly_elt; // expected-error{{invalid vector element type}}
 struct aggr { signed char c; };
-typedef __attribute__((neon_vector_type(8))) struct aggr aggregate_elt; // expected-error{{invalid vector element type}}
+typedef __attribute__((neon_vector_type(8))) struct aggr aggregate_elt; // expected-error{{invalid vector element type}} \
+                                                                                                            // expected-warning {{attributes appear before keyword struct are ignored}}
 
 // The total vector size must be 64 or 128 bits.
 typedef __attribute__((neon_vector_type(1))) int int32x1_t; // expected-error{{Neon vector size must be 64 or 128 bits}}
Index: test/Sema/warn-cast-align.c
===================================================================
--- test/Sema/warn-cast-align.c	(revision 122385)
+++ test/Sema/warn-cast-align.c	(working copy)
@@ -28,7 +28,7 @@
 }
 
 // Aligned struct.
-__attribute__((align(16))) struct A {
+struct __attribute__((align(16))) A {
   char buffer[16];
 };
 void test2(char *P) {
Index: test/Parser/attributes.c
===================================================================
--- test/Parser/attributes.c	(revision 122385)
+++ test/Parser/attributes.c	(working copy)
@@ -56,3 +56,12 @@
 
 // PR6287
 void __attribute__((returns_twice)) returns_twice_test();
+
+__attribute__ ((__packed__)) struct packed_struct { // expected-warning {{attributes appear before keyword struct are ignored}}
+char c;
+};
+
+__attribute__ ((__packed__)) union packed_union { // expected-warning {{attributes appear before keyword union are ignored}}
+char c;
+};
+
Index: test/Parser/cxx-attributes.cpp
===================================================================
--- test/Parser/cxx-attributes.cpp	(revision 122385)
+++ test/Parser/cxx-attributes.cpp	(working copy)
@@ -7,3 +7,5 @@
     __attribute__ (( __format__(__printf__,2,3) )) {}
 };
 
+__attribute__ ((__packed__)) class foo{ // expected-warning {{attributes appear before keyword class are ignored}}
+};
\ No newline at end of file
Index: include/clang/Basic/DiagnosticParseKinds.td
===================================================================
--- include/clang/Basic/DiagnosticParseKinds.td	(revision 122385)
+++ include/clang/Basic/DiagnosticParseKinds.td	(working copy)
@@ -210,6 +210,8 @@
   "unexpected ':' in nested name specifier">;
 def err_bool_redeclaration : Error<
   "redeclaration of C++ built-in type 'bool'">;
+def warn_attributes_ignored : Warning<
+  "attributes appear before keyword %select{class|struct|union}0 are ignored">;
 
 /// Objective-C parser diagnostics
 def err_expected_minus_or_plus : Error<
Index: lib/Parse/ParseDeclCXX.cpp
===================================================================
--- lib/Parse/ParseDeclCXX.cpp	(revision 122385)
+++ lib/Parse/ParseDeclCXX.cpp	(working copy)
@@ -685,6 +685,14 @@
     SuppressingAccessChecks = true;
   }
 
+  // Attributes appear before class/struct/union are ignored
+  if (DS.getAttributes()) {
+      Diag(StartLoc, diag::warn_attributes_ignored) 
+    << (TagType == DeclSpec::TST_class? 0
+        : TagType == DeclSpec::TST_struct? 1
+        : 2);
+  }
+
   AttributeList *AttrList = 0;
   // If attributes exist after tag, parse them.
   if (Tok.is(tok::kw___attribute))
