ART: Replace COMPILE_ASSERT with static_assert (runtime)
Replace all occurrences of COMPILE_ASSERT in the runtime tree.
Change-Id: I01e420899c760094fb342cc6cb9e692dd670a0b2
diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h
index 892bf44..5f72dbe 100644
--- a/runtime/mirror/class-inl.h
+++ b/runtime/mirror/class-inl.h
@@ -279,7 +279,7 @@
template <bool throw_on_failure, bool use_referrers_cache, InvokeType throw_invoke_type>
inline bool Class::ResolvedMethodAccessTest(Class* access_to, ArtMethod* method,
uint32_t method_idx, DexCache* dex_cache) {
- COMPILE_ASSERT(throw_on_failure || throw_invoke_type == kStatic, non_default_throw_invoke_type);
+ static_assert(throw_on_failure || throw_invoke_type == kStatic, "Non-default throw invoke type");
DCHECK_EQ(use_referrers_cache, dex_cache == nullptr);
if (UNLIKELY(!this->CanAccess(access_to))) {
// The referrer class can't access the method's declaring class but may still be able
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index 828d986..61bfe41 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -117,7 +117,7 @@
self->SetException(gc_safe_throw_location, old_exception.Get());
self->SetExceptionReportedToInstrumentation(is_exception_reported);
}
- COMPILE_ASSERT(sizeof(Status) == sizeof(uint32_t), size_of_status_not_uint32);
+ static_assert(sizeof(Status) == sizeof(uint32_t), "Size of status not equal to uint32");
if (Runtime::Current()->IsActiveTransaction()) {
SetField32Volatile<true>(OFFSET_OF_OBJECT_MEMBER(Class, status_), new_status);
} else {
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h
index 68fbb8b..21cf53f 100644
--- a/runtime/mirror/class.h
+++ b/runtime/mirror/class.h
@@ -131,7 +131,7 @@
template<VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags>
Status GetStatus() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- COMPILE_ASSERT(sizeof(Status) == sizeof(uint32_t), size_of_status_not_uint32);
+ static_assert(sizeof(Status) == sizeof(uint32_t), "Size of status not equal to uint32");
return static_cast<Status>(
GetField32Volatile<kVerifyFlags>(OFFSET_OF_OBJECT_MEMBER(Class, status_)));
}