[clang] [clang] Stub out gcc_struct attribute (PR #71148)

Dan Klishch via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 14 12:40:04 PST 2023


================
@@ -5031,7 +5031,12 @@ void RecordDecl::completeDefinition() {
 /// This which can be turned on with an attribute, pragma, or the
 /// -mms-bitfields command-line option.
 bool RecordDecl::isMsStruct(const ASTContext &C) const {
-  return hasAttr<MSStructAttr>() || C.getLangOpts().MSBitfields == 1;
+  if (hasAttr<MSStructAttr>())
+    return true;
+  if (hasAttr<GCCStructAttr>())
+    return false;
+  return C.getLangOpts().MSBitfields.value_or(
----------------
DanShaders wrote:

And, for example, for C++ ABI we do the same:
https://github.com/llvm/llvm-project/blob/d19616fc66008ad128ecd21536c6e52992bea4e6/clang/lib/AST/ASTContext.cpp#L813-L816

https://github.com/llvm/llvm-project/pull/71148


More information about the cfe-commits mailing list