[vm] Delete disallowed constructors/operators

This allows the compiler to emit better errors. It also allows the
compiler to detect when a class accidentally references its own
supposedly disallowed constructors/operators (e.g., see dartutils.cc).

Notably, this exposes a number of private member variables that are
unused, but some that are used only in certain build configurations.
It would arguably be better to only define the variables when they're
needed, but that's deferred to a subsequent CL.

Change-Id: I5d0e6697eebebc9321fae1ff49cc68caf557b903
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97175
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn
index 919ee59..9ef4444 100644
--- a/runtime/BUILD.gn
+++ b/runtime/BUILD.gn
@@ -152,6 +152,7 @@
       "-Wall",
       "-Wextra",  # Also known as -W.
       "-Wno-unused-parameter",
+      "-Wno-unused-private-field",
       "-Wnon-virtual-dtor",
       "-Wvla",
       "-Wno-conversion-null",
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 9252508..9211fc0 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -801,9 +801,9 @@
 Dart_CObject CObject::api_null_ = {Dart_CObject_kNull, {0}};
 Dart_CObject CObject::api_true_ = {Dart_CObject_kBool, {true}};
 Dart_CObject CObject::api_false_ = {Dart_CObject_kBool, {false}};
-CObject CObject::null_ = CObject(&api_null_);
-CObject CObject::true_ = CObject(&api_true_);
-CObject CObject::false_ = CObject(&api_false_);
+CObject CObject::null_(&api_null_);
+CObject CObject::true_(&api_true_);
+CObject CObject::false_(&api_false_);
 
 CObject* CObject::Null() {
   return &null_;
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index 3078d07..be43b30 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -531,8 +531,8 @@
 #if !defined(DISALLOW_COPY_AND_ASSIGN)
 #define DISALLOW_COPY_AND_ASSIGN(TypeName)                                     \
  private:                                                                      \
-  TypeName(const TypeName&);                                                   \
-  void operator=(const TypeName&)
+  TypeName(const TypeName&) = delete;                                          \
+  void operator=(const TypeName&) = delete
 #endif  // !defined(DISALLOW_COPY_AND_ASSIGN)
 
 // A macro to disallow all the implicit constructors, namely the default
@@ -543,7 +543,7 @@
 #if !defined(DISALLOW_IMPLICIT_CONSTRUCTORS)
 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)                               \
  private:                                                                      \
-  TypeName();                                                                  \
+  TypeName() = delete;                                                         \
   DISALLOW_COPY_AND_ASSIGN(TypeName)
 #endif  // !defined(DISALLOW_IMPLICIT_CONSTRUCTORS)
 
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 250aa7b..4eb21a0 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -166,10 +166,10 @@
                                                                                \
  private: /* NOLINT */                                                         \
   void* operator new(size_t size);                                             \
-  object(const object& value);                                                 \
-  void operator=(Raw##super* value);                                           \
-  void operator=(const object& value);                                         \
-  void operator=(const super& value);
+  object(const object& value) = delete;                                        \
+  void operator=(Raw##super* value) = delete;                                  \
+  void operator=(const object& value) = delete;                                \
+  void operator=(const super& value) = delete;
 
 // Conditionally include object_service.cc functionality in the vtable to avoid
 // link errors like the following: