@@ -6172,6 +6172,27 @@ static void handleMSConstexprAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
61726172 D->addAttr (::new (S.Context ) MSConstexprAttr (S.Context , AL));
61736173}
61746174
6175+ static void handleMSStructAttr (Sema &S, Decl *D, const ParsedAttr &AL) {
6176+ if (const auto *First = D->getAttr <GCCStructAttr>()) {
6177+ S.Diag (AL.getLoc (), diag::err_attributes_are_not_compatible)
6178+ << AL << First << 0 ;
6179+ S.Diag (First->getLocation (), diag::note_conflicting_attribute);
6180+ return ;
6181+ }
6182+
6183+ D->addAttr (::new (S.Context ) MSStructAttr (S.Context , AL));
6184+ }
6185+
6186+ static void handleGCCStructAttr (Sema &S, Decl *D, const ParsedAttr &AL) {
6187+ if (const auto *First = D->getAttr <MSStructAttr>()) {
6188+ S.Diag (AL.getLoc (), diag::err_attributes_are_not_compatible)
6189+ << AL << First << 0 ;
6190+ S.Diag (First->getLocation (), diag::note_conflicting_attribute);
6191+ return ;
6192+ }
6193+ D->addAttr (::new (S.Context ) GCCStructAttr (S.Context , AL));
6194+ }
6195+
61756196static void handleAbiTagAttr (Sema &S, Decl *D, const ParsedAttr &AL) {
61766197 SmallVector<StringRef, 4 > Tags;
61776198 for (unsigned I = 0 , E = AL.getNumArgs (); I != E; ++I) {
@@ -7910,6 +7931,14 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL,
79107931 case ParsedAttr::AT_VTablePointerAuthentication:
79117932 handleVTablePointerAuthentication (S, D, AL);
79127933 break ;
7934+
7935+ case ParsedAttr::AT_MSStruct:
7936+ handleMSStructAttr (S, D, AL);
7937+ break ;
7938+
7939+ case ParsedAttr::AT_GCCStruct:
7940+ handleGCCStructAttr (S, D, AL);
7941+ break ;
79137942 }
79147943}
79157944
0 commit comments