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

John McCall via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 14 11:50:32 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(
----------------
rjmccall wrote:

Is there a reason we don't just set the lang opt correctly for the target?  I'm pretty sure language option defaults depending on target settings is well-established.

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


More information about the cfe-commits mailing list