From cd929d8e65506e5f46f27a3e1f12dfc55555c7bd Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Fri, 22 Jan 2021 15:17:58 +0100 Subject: [PATCH] meta: review + tests (code coverage) for implicitly generated default constructors --- src/entt/meta/meta.hpp | 2 +- test/entt/meta/meta_ctor.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 3e2a7e61e..3b2324ac0 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -176,7 +176,7 @@ class ENTT_API meta_node { nullptr, nullptr, 0u, - [](typename meta_ctor_node::size_type) ENTT_NOEXCEPT -> meta_type_node * { return nullptr; }, + nullptr, [](meta_any * const) { return meta_any{std::in_place_type}; } }; diff --git a/test/entt/meta/meta_ctor.cpp b/test/entt/meta/meta_ctor.cpp index 547500a0a..27724682d 100644 --- a/test/entt/meta/meta_ctor.cpp +++ b/test/entt/meta/meta_ctor.cpp @@ -221,6 +221,7 @@ TEST_F(MetaCtor, ImplicitlyGeneratedDefaultConstructor) { // default constructor is implicitly generated ASSERT_EQ(counter, 1); ASSERT_TRUE(type.ctor<>()); + ASSERT_EQ(type.ctor<>().arg(0), entt::meta_type{}); auto any = type.ctor<>().invoke();