From: Eric Fiselier Date: Wed, 12 Oct 2016 08:09:22 +0000 (+0000) Subject: Protect special members of NullBase archetype to avoid exposing them X-Git-Tag: llvmorg-4.0.0-rc1~7411 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=411e1f8288f33964723c059953f14970cb7861e5;p=platform%2Fupstream%2Fllvm.git Protect special members of NullBase archetype to avoid exposing them llvm-svn: 283983 --- diff --git a/libcxx/test/support/archetypes.hpp b/libcxx/test/support/archetypes.hpp index c09aa70..b9b2853 100644 --- a/libcxx/test/support/archetypes.hpp +++ b/libcxx/test/support/archetypes.hpp @@ -13,7 +13,14 @@ namespace ArchetypeBases { template struct DepType : T {}; -struct NullBase {}; +struct NullBase { +protected: + NullBase() = default; + NullBase(NullBase const&) = default; + NullBase& operator=(NullBase const&) = default; + NullBase(NullBase &&) = default; + NullBase& operator=(NullBase &&) = default; +}; template struct TestBase { @@ -66,7 +73,7 @@ struct TestBase { ++alive; ++constructed; ++value_constructed; } template ::type = true> - TestBase(std::initializer_list& il, int y = 0) noexcept : value(il.size()) { + explicit TestBase(std::initializer_list& il, int y = 0) noexcept : value(il.size()) { ++alive; ++constructed; ++value_constructed; } TestBase& operator=(int xvalue) noexcept { @@ -79,11 +86,11 @@ protected: assert(value != -999); assert(alive > 0); --alive; ++destroyed; value = -999; } - TestBase(TestBase const& o) noexcept : value(o.value) { + explicit TestBase(TestBase const& o) noexcept : value(o.value) { assert(o.value != -1); assert(o.value != -999); ++alive; ++constructed; ++copy_constructed; } - TestBase(TestBase && o) noexcept : value(o.value) { + explicit TestBase(TestBase && o) noexcept : value(o.value) { assert(o.value != -1); assert(o.value != -999); ++alive; ++constructed; ++move_constructed; o.value = -1;