diff --git a/include/boost/sml.hpp b/include/boost/sml.hpp index 6badf558..f811dfde 100644 --- a/include/boost/sml.hpp +++ b/include/boost/sml.hpp @@ -581,13 +581,13 @@ auto get_type_name(const char *ptr, index_sequence) { template const char *get_type_name() { #if defined(_MSC_VER) && !defined(__clang__) - return detail::get_type_name(__FUNCSIG__, make_index_sequence{}); + return detail::get_type_name(__FUNCSIG__, make_index_sequence{}); #elif defined(__clang__) && (__clang_major__ >= 12) return detail::get_type_name(__PRETTY_FUNCTION__, make_index_sequence{}); #elif defined(__clang__) return detail::get_type_name(__PRETTY_FUNCTION__, make_index_sequence{}); #elif defined(__GNUC__) - return detail::get_type_name(__PRETTY_FUNCTION__, make_index_sequence{}); + return detail::get_type_name(__PRETTY_FUNCTION__, make_index_sequence{}); #endif } #if defined(__cpp_nontype_template_parameter_class) || \ diff --git a/test/ut/type_traits.cpp b/test/ut/type_traits.cpp index 737c71e5..2f9a81bf 100644 --- a/test/ut/type_traits.cpp +++ b/test/ut/type_traits.cpp @@ -5,6 +5,8 @@ // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // +#include + #include "boost/sml.hpp" BOOST_SML_NAMESPACE_BEGIN @@ -67,5 +69,10 @@ test is_empty_type = [] { static_expect(!is_empty::value); }; +test type_name = [] { + expect(std::string("int") == get_type_name()); + expect(std::string("void") == get_type_name()); +}; + } // namespace aux BOOST_SML_NAMESPACE_END