File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -5125,10 +5125,10 @@ void RecordDecl::completeDefinition() {
51255125// / This which can be turned on with an attribute, pragma, or the
51265126// / -mms-bitfields command-line option.
51275127bool RecordDecl::isMsStruct (const ASTContext &C) const {
5128- if (hasAttr<MSStructAttr>())
5129- return true ;
51305128 if (hasAttr<GCCStructAttr>())
51315129 return false ;
5130+ if (hasAttr<MSStructAttr>())
5131+ return true ;
51325132 auto LayoutCompatibility = C.getLangOpts ().getLayoutCompatibility ();
51335133 if (LayoutCompatibility == LangOptions::LayoutCompatibilityKind::Default)
51345134 return C.defaultsToMsStruct ();
Original file line number Diff line number Diff line change 1+ // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-pc-linux-gnu %s
2+ // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-pc-linux-gnu -fms-layout-compatibility=microsoft %s
3+ // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-pc-windows-gnu %s
4+ // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-pc-windows-gnu -fms-layout-compatibility=itanium %s
5+
6+ struct {
7+ int a : 24 ;
8+ char b : 8 ;
9+ } __attribute__((gcc_struct )) t1 ;
10+ static int a1 [(sizeof (t1 ) == 4 ) - 1 ];
11+
12+ #pragma ms_struct on
13+ struct {
14+ int a : 24 ;
15+ char b : 8 ;
16+ } __attribute__((gcc_struct )) t2 ;
17+ static int a2 [(sizeof (t2 ) == 4 ) - 1 ];
18+ #pragma ms_struct off
You can’t perform that action at this time.
0 commit comments