// // immer: immutable data structures for C++ // Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente // // This software is distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt // // Thanks to @jeaye for reporting this issue // https://github.com/arximboldi/immer/issues/177 #include #include #include #include struct object; template struct is_valid_type { static bool constexpr value{false}; }; template <> struct is_valid_type { static bool constexpr value{true}; }; struct object { using vector_type = immer::vector>; template object(T&&) { static_assert(is_valid_type::value, "invalid type"); } }; TEST_CASE("strange bad constructor called") { object::vector_type::transient_type t; // If this next line is commented out, the code compiles. (void) t.persistent(); }