summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2015-04-03 21:28:42 -0700
committer Andreas Gampe <agampe@google.com> 2015-04-06 14:03:17 -0700
commit758a801b66c134361a7b43f7e83f85d1fb800c4c (patch)
tree35b060c780fcf6e7c268fec47df40c74b5ab8b05
parente8aae00fa400efbb8f998a5dbf68eb42810889c1 (diff)
ART: Enable Clang's -Wdeprecated
Replace throw() with noexcept. Add default copy constructors and copy assignment constructors for cases with destructors, as the implicit definition is deprecated. Change-Id: Ice306a3f510b072b00bec4d4360f7c8055135c9d
-rw-r--r--build/Android.common_build.mk3
-rw-r--r--build/Android.gtest.mk8
-rw-r--r--cmdline/unit.h1
-rw-r--r--compiler/elf_builder.h2
-rw-r--r--compiler/utils/array_ref.h2
-rw-r--r--runtime/base/allocator.h4
-rw-r--r--runtime/base/arena_containers.h1
-rw-r--r--runtime/gc_root.h1
-rw-r--r--runtime/handle_scope.h2
-rw-r--r--runtime/oat.h4
-rw-r--r--runtime/oat_file.h3
-rw-r--r--runtime/safe_map.h1
12 files changed, 26 insertions, 6 deletions
diff --git a/build/Android.common_build.mk b/build/Android.common_build.mk
index 91b66207b2..8b4be82f84 100644
--- a/build/Android.common_build.mk
+++ b/build/Android.common_build.mk
@@ -138,6 +138,9 @@ art_clang_cflags += -Wint-to-void-pointer-cast
# Enable warning of wrong unused annotations.
art_clang_cflags += -Wused-but-marked-unused
+# Enable warning for deprecated language features.
+art_clang_cflags += -Wdeprecated
+
# GCC-only warnings.
art_gcc_cflags := -Wunused-but-set-parameter
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 86cc5adbeb..6714480393 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -257,7 +257,7 @@ LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk
LOCAL_ADDITIONAL_DEPENDENCIES += art/build/Android.gtest.mk
$(eval $(call set-target-local-clang-vars))
$(eval $(call set-target-local-cflags-vars,debug))
-LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused # gtest issue
+LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused -Wno-deprecated # gtest issue
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
@@ -272,7 +272,7 @@ LOCAL_STATIC_LIBRARIES := libgtest_host
LOCAL_LDLIBS += -ldl -lpthread
LOCAL_MULTILIB := both
LOCAL_CLANG := $(ART_HOST_CLANG)
-LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused # gtest issue
+LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused -Wno-deprecated # gtest issue
LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk
LOCAL_ADDITIONAL_DEPENDENCIES += art/build/Android.gtest.mk
include $(BUILD_HOST_SHARED_LIBRARY)
@@ -425,7 +425,7 @@ define define-art-gtest
LOCAL_MODULE_PATH_32 := $$(ART_TARGET_NATIVETEST_OUT)/$$(ART_TARGET_ARCH_32)
LOCAL_MODULE_PATH_64 := $$(ART_TARGET_NATIVETEST_OUT)/$$(ART_TARGET_ARCH_64)
LOCAL_MULTILIB := both
- LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused # gtest issue
+ LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused -Wno-deprecated # gtest issue
include $$(BUILD_EXECUTABLE)
library_path :=
2nd_library_path :=
@@ -464,7 +464,7 @@ test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_GTEST_$$(art_gtest_
LOCAL_MULTILIB := both
LOCAL_MODULE_STEM_32 := $$(art_gtest_name)32
LOCAL_MODULE_STEM_64 := $$(art_gtest_name)64
- LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused # gtest issue
+ LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused -Wno-deprecated # gtest issue
include $$(BUILD_HOST_EXECUTABLE)
ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES :=
diff --git a/cmdline/unit.h b/cmdline/unit.h
index 6b53b1832b..ad6a03d12f 100644
--- a/cmdline/unit.h
+++ b/cmdline/unit.h
@@ -24,6 +24,7 @@ struct Unit {
// Avoid 'Conditional jump or move depends on uninitialised value(s)' errors
// when running valgrind by specifying a user-defined constructor.
Unit() {}
+ Unit(const Unit&) = default;
~Unit() {}
bool operator==(Unit) const {
return true;
diff --git a/compiler/elf_builder.h b/compiler/elf_builder.h
index 9ab3602606..124ed03c21 100644
--- a/compiler/elf_builder.h
+++ b/compiler/elf_builder.h
@@ -40,6 +40,7 @@ class ElfSectionBuilder : public ValueObject {
section_.sh_addralign = align;
section_.sh_entsize = entsize;
}
+ ElfSectionBuilder(const ElfSectionBuilder&) = default;
~ElfSectionBuilder() {}
@@ -144,6 +145,7 @@ class ElfRawSectionBuilder FINAL : public ElfSectionBuilder<Elf_Word, Elf_Sword,
: ElfSectionBuilder<Elf_Word, Elf_Sword, Elf_Shdr>(sec_name, type, flags, link, info, align,
entsize) {
}
+ ElfRawSectionBuilder(const ElfRawSectionBuilder&) = default;
~ElfRawSectionBuilder() {}
diff --git a/compiler/utils/array_ref.h b/compiler/utils/array_ref.h
index b1b0ee5e53..ff5a77c97a 100644
--- a/compiler/utils/array_ref.h
+++ b/compiler/utils/array_ref.h
@@ -89,6 +89,8 @@ class ArrayRef {
: array_(v.data()), size_(v.size()) {
}
+ ArrayRef(const ArrayRef&) = default;
+
// Assignment operators.
ArrayRef& operator=(const ArrayRef& other) {
diff --git a/runtime/base/allocator.h b/runtime/base/allocator.h
index 2d67c8b032..07daa7e0fa 100644
--- a/runtime/base/allocator.h
+++ b/runtime/base/allocator.h
@@ -114,12 +114,12 @@ class TrackingAllocatorImpl : public std::allocator<T> {
// Used internally by STL data structures.
template <class U>
- TrackingAllocatorImpl(const TrackingAllocatorImpl<U, kTag>& alloc) throw() {
+ TrackingAllocatorImpl(const TrackingAllocatorImpl<U, kTag>& alloc) noexcept {
UNUSED(alloc);
}
// Used internally by STL data structures.
- TrackingAllocatorImpl() throw() {
+ TrackingAllocatorImpl() noexcept {
static_assert(kTag < kAllocatorTagCount, "kTag must be less than kAllocatorTagCount");
}
diff --git a/runtime/base/arena_containers.h b/runtime/base/arena_containers.h
index e6fe6c0ad4..d6c4a54b52 100644
--- a/runtime/base/arena_containers.h
+++ b/runtime/base/arena_containers.h
@@ -67,6 +67,7 @@ class ArenaAllocatorAdapterKindImpl<false> {
public:
// Not tracking allocations, ignore the supplied kind and arbitrarily provide kArenaAllocSTL.
explicit ArenaAllocatorAdapterKindImpl(ArenaAllocKind kind ATTRIBUTE_UNUSED) {}
+ ArenaAllocatorAdapterKindImpl(const ArenaAllocatorAdapterKindImpl&) = default;
ArenaAllocatorAdapterKindImpl& operator=(const ArenaAllocatorAdapterKindImpl&) = default;
ArenaAllocKind Kind() { return kArenaAllocSTL; }
};
diff --git a/runtime/gc_root.h b/runtime/gc_root.h
index 4164bbddc2..2f4da3f2ca 100644
--- a/runtime/gc_root.h
+++ b/runtime/gc_root.h
@@ -54,6 +54,7 @@ class RootInfo {
explicit RootInfo(RootType type, uint32_t thread_id = 0)
: type_(type), thread_id_(thread_id) {
}
+ RootInfo(const RootInfo&) = default;
virtual ~RootInfo() {
}
RootType GetType() const {
diff --git a/runtime/handle_scope.h b/runtime/handle_scope.h
index a8365782a1..271312ea9f 100644
--- a/runtime/handle_scope.h
+++ b/runtime/handle_scope.h
@@ -133,6 +133,8 @@ class HandleWrapper : public MutableHandle<T> {
: MutableHandle<T>(handle), obj_(obj) {
}
+ HandleWrapper(const HandleWrapper&) = default;
+
~HandleWrapper() {
*obj_ = MutableHandle<T>::Get();
}
diff --git a/runtime/oat.h b/runtime/oat.h
index 120de6d11f..de95fef550 100644
--- a/runtime/oat.h
+++ b/runtime/oat.h
@@ -156,6 +156,8 @@ class PACKED(4) OatMethodOffsets {
~OatMethodOffsets();
+ OatMethodOffsets& operator=(const OatMethodOffsets&) = default;
+
uint32_t code_offset_;
};
@@ -169,6 +171,8 @@ class PACKED(4) OatQuickMethodHeader {
~OatQuickMethodHeader();
+ OatQuickMethodHeader& operator=(const OatQuickMethodHeader&) = default;
+
// The offset in bytes from the start of the mapping table to the end of the header.
uint32_t mapping_table_offset_;
// The offset in bytes from the start of the vmap table to the end of the header.
diff --git a/runtime/oat_file.h b/runtime/oat_file.h
index 2b9ef9da71..73a8c8e45a 100644
--- a/runtime/oat_file.h
+++ b/runtime/oat_file.h
@@ -134,8 +134,11 @@ class OatFile FINAL {
OatMethod(const uint8_t* base, const uint32_t code_offset)
: begin_(base), code_offset_(code_offset) {
}
+ OatMethod(const OatMethod&) = default;
~OatMethod() {}
+ OatMethod& operator=(const OatMethod&) = default;
+
// A representation of an invalid OatMethod, used when an OatMethod or OatClass can't be found.
// See ClassLinker::FindOatMethodFor.
static const OatMethod Invalid() {
diff --git a/runtime/safe_map.h b/runtime/safe_map.h
index f9d81dc3cb..402c7e9cb5 100644
--- a/runtime/safe_map.h
+++ b/runtime/safe_map.h
@@ -44,6 +44,7 @@ class SafeMap {
typedef typename ::std::map<K, V, Comparator, Allocator>::value_type value_type;
SafeMap() = default;
+ SafeMap(const SafeMap&) = default;
explicit SafeMap(const key_compare& cmp, const allocator_type& allocator = allocator_type())
: map_(cmp, allocator) {
}