Ignore warning for instantiation after specialization.
Bug: http://b/31532493
The false template specialization is indeed a duplicate, so we can
remove it, but the ART team would prefer to keep this explicit.
art/runtime/base/arena_allocator.cc:147:16: error: explicit
instantiation of 'ArenaAllocatorStatsImpl<false>' that occurs after an
explicit specialization has no effect
[-Werror,-Winstantiation-after-specialization]
template class ArenaAllocatorStatsImpl<kArenaAllocatorCountAllocations>;
^
art/runtime/base/arena_allocator.h:105:7: note: previous
template specialization is here
class ArenaAllocatorStatsImpl<false> {
^
Test: Builds correctly with latest toolchain.
Change-Id: Ifbcb3b98ff4451b9860a6c6c6b085745f89c0a64
diff --git a/runtime/base/arena_allocator.cc b/runtime/base/arena_allocator.cc
index 61e0aab..1caf0c0 100644
--- a/runtime/base/arena_allocator.cc
+++ b/runtime/base/arena_allocator.cc
@@ -144,8 +144,11 @@
}
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Winstantiation-after-specialization"
// Explicitly instantiate the used implementation.
template class ArenaAllocatorStatsImpl<kArenaAllocatorCountAllocations>;
+#pragma GCC diagnostic pop
void ArenaAllocatorMemoryTool::DoMakeDefined(void* ptr, size_t size) {
MEMORY_TOOL_MAKE_DEFINED(ptr, size);