}
def MsStruct : InheritableAttr {
- let Spellings = [Declspec<"ms_struct">];
+ let Spellings = [GNU<"ms_struct">, CXX11<"gnu", "ms_struct">];
+ let Subjects = [Record];
}
def DLLExport : InheritableAttr, TargetSpecificAttr {
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) {
} __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;
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
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}}
+};