There is no such thing as __declspec(ms_struct), this is a GNU attribute. Switched the attribute to have the proper spelling, gave it a subject, updated the warning to be more accurate, and updated the test case as appropriate.

llvm-svn: 195277
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index 4a412d1..27a27e3 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -1068,7 +1068,8 @@
 }
 
 def MsStruct : InheritableAttr {
-  let Spellings = [Declspec<"ms_struct">];
+  let Spellings = [GNU<"ms_struct">, CXX11<"gnu", "ms_struct">];
+  let Subjects = [Record];
 }
 
 def DLLExport : InheritableAttr, TargetSpecificAttr {
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 6460b04..1672567 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -1278,7 +1278,8 @@
                 MsStructAttr(Attr.getRange(), S.Context,
                              Attr.getAttributeSpellingListIndex()));
   else
-    S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << Attr.getName();
+    S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
+      << Attr.getName() << ExpectedStructOrUnionOrClass;
 }
 
 static void handleIBAction(Sema &S, Decl *D, const AttributeList &Attr) {
diff --git a/clang/test/Sema/pragma-ms_struct.c b/clang/test/Sema/pragma-ms_struct.c
index 6533320..14e7fde 100644
--- a/clang/test/Sema/pragma-ms_struct.c
+++ b/clang/test/Sema/pragma-ms_struct.c
@@ -25,7 +25,7 @@
 } __attribute__((__ms_struct__)) t1;
 
 struct S {
-		   double __attribute__((ms_struct)) d;	// expected-warning {{'ms_struct' attribute ignored}}
+		   double __attribute__((ms_struct)) d;	// expected-warning {{'ms_struct' attribute only applies to struct, union or class}}
                    unsigned long bf_1 : 12;
                    unsigned long : 0;
                    unsigned long bf_2 : 12;
@@ -36,7 +36,7 @@
   A = 0,
   B,
   C
-} __attribute__((ms_struct)) e1; // expected-warning {{'ms_struct' attribute ignored}}
+} __attribute__((ms_struct)) e1; // expected-warning {{'ms_struct' attribute only applies to struct, union or class}}
 
 // rdar://10513599
 #pragma ms_struct on
@@ -52,10 +52,12 @@
 void *pv1;
 Foo foo;
 unsigned short fInited : 1;
-void *pv2;		
-} PackOddity;		
+void *pv2;
+} PackOddity;
 
 #pragma ms_struct off
 
 static int arr[sizeof(PackOddity) == 40 ? 1 : -1];
 
+__declspec(ms_struct) struct bad { // expected-warning {{unknown __declspec attribute 'ms_struct' ignored}}
+};