diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 919ee59af4a..9ef44448110 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -152,6 +152,7 @@ config("dart_config") { "-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 92525081d64..9211fc0c337 100644 --- a/runtime/bin/dartutils.cc +++ b/runtime/bin/dartutils.cc @@ -801,9 +801,9 @@ Dart_Handle DartUtils::EnvironmentCallback(Dart_Handle name) { 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 3078d075f34..be43b300f2d 100644 --- a/runtime/platform/globals.h +++ b/runtime/platform/globals.h @@ -531,8 +531,8 @@ inline double MicrosecondsToMilliseconds(int64_t micros) { #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 @@ inline double MicrosecondsToMilliseconds(int64_t micros) { #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 250aa7b3606..4eb21a0e138 100644 --- a/runtime/vm/object.h +++ b/runtime/vm/object.h @@ -166,10 +166,10 @@ class Symbols; \ 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: