summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dan Albert <danalbert@google.com> 2015-10-26 11:39:41 -0700
committer Dan Albert <danalbert@google.com> 2015-10-26 11:50:40 -0700
commit05ff5a4ad666d9eb583ff343c1cbba886d7621b1 (patch)
treea7a05b44cd2b630d22e7fc7ca02cdd3ae38326b8
parente04f37908bfd72382163c1285853e662373229a2 (diff)
Make dchecked_vector C++11 compatible.
Since GCC's C++14 ABI is incorrect, we need to drop GCC users back to C++11. Since ART does not unconditionally use clang, it cannot unconditionally use C++14 either. This constructor for std::vector was added in C++14, so we need to implement it ourselves. Bug: http://b/25022512 Change-Id: Ib31a312c8c91fe6eccf24d59ef58f2fa8e634e1c
-rw-r--r--runtime/base/dchecked_vector.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/base/dchecked_vector.h b/runtime/base/dchecked_vector.h
index 6ec573a5fb..2bd12df2c3 100644
--- a/runtime/base/dchecked_vector.h
+++ b/runtime/base/dchecked_vector.h
@@ -59,8 +59,10 @@ class dchecked_vector : private std::vector<T, Alloc> {
: Base() { }
explicit dchecked_vector(const allocator_type& alloc)
: Base(alloc) { }
+ // Note that we cannot forward to std::vector(size_type, const allocator_type&) because it is not
+ // available in C++11, which is the latest GCC can support. http://b/25022512
explicit dchecked_vector(size_type n, const allocator_type& alloc = allocator_type())
- : Base(n, alloc) { }
+ : Base(alloc) { resize(n); }
dchecked_vector(size_type n,
const value_type& value,
const allocator_type& alloc = allocator_type())