Make classes derived from buffer<T> final to silence the virtual destructor warning. (#1937)

Co-authored-by: Bart Siwek <bsiwek@cisco.com>
This commit is contained in:
Bart Siwek
2020-10-16 02:41:56 +02:00
committed by GitHub
parent 811c8b58c5
commit 271eff149f
6 changed files with 11 additions and 15 deletions
+2 -2
View File
@@ -78,7 +78,7 @@ TEST(BufferTest, Indestructible) {
"buffer's destructor is protected");
}
template <typename T> struct mock_buffer : buffer<T> {
template <typename T> struct mock_buffer final : buffer<T> {
MOCK_METHOD1(do_grow, size_t(size_t capacity));
void grow(size_t capacity) { this->set(this->data(), do_grow(capacity)); }
@@ -368,7 +368,7 @@ TEST(ArgTest, PointerArg) {
struct check_custom {
test_result operator()(
fmt::basic_format_arg<fmt::format_context>::handle h) const {
struct test_buffer : fmt::detail::buffer<char> {
struct test_buffer final : fmt::detail::buffer<char> {
char data[10];
test_buffer() : fmt::detail::buffer<char>(data, 0, 10) {}
void grow(size_t) {}