]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/d/dmd/dclass.c
d: Merge upstream dmd 13d67c575.
[thirdparty/gcc.git] / gcc / d / dmd / dclass.c
index 73e571b4da9276a407127d663c27d670015425ec..7481f910e1108461765d524a22d710558cce3329 100644 (file)
@@ -1100,7 +1100,7 @@ void ClassDeclaration::finalizeSize()
     {
         alignsize = target.ptrsize;
         structsize = target.ptrsize;      // allow room for __vptr
-        if (!isCPPclass())
+        if (hasMonitor())
             structsize += target.ptrsize; // allow room for __monitor
     }
 
@@ -1133,6 +1133,14 @@ void ClassDeclaration::finalizeSize()
     checkOverlappedFields();
 }
 
+/**************
+ * Returns: true if there's a __monitor field
+ */
+bool ClassDeclaration::hasMonitor()
+{
+    return classKind == ClassKind::d;
+}
+
 /**********************************************************
  * fd is in the vtbl[] for this class.
  * Return 1 if function is hidden (not findable through search).