From 2fae3ae835c0d9c7468a7d44734fa6f00e535073 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 26 Jul 2016 01:08:03 -0400 Subject: [PATCH] fix regression in entry constructor (#950) --- include/libtorrent/entry.hpp | 2 +- test/test_bencoding.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/libtorrent/entry.hpp b/include/libtorrent/entry.hpp index 5062e1e5b..810f61208 100644 --- a/include/libtorrent/entry.hpp +++ b/include/libtorrent/entry.hpp @@ -135,7 +135,7 @@ namespace libtorrent // construct an empty entry of the specified type. // see data_type enum. - explicit entry(data_type t); + entry(data_type t); // hidden entry(entry const& e); diff --git a/test/test_bencoding.cpp b/test/test_bencoding.cpp index 512076574..3e7badf35 100644 --- a/test/test_bencoding.cpp +++ b/test/test_bencoding.cpp @@ -134,6 +134,13 @@ TORRENT_TEST(undefined_node2) TEST_EQUAL(encode(e), "d4:info0:e"); } +TORRENT_TEST(implicit_construct) +{ + entry e(entry::list_t); + e.list().push_back(entry::list_t); + TEST_EQUAL(e.list().back().type(), entry::list_t); +} + #ifndef TORRENT_NO_DEPRECATE TORRENT_TEST(lazy_entry) {