@@ -593,8 +593,7 @@ auto assert_in_bounds(auto&& x, auto&& arg CPP2_SOURCE_LOCATION_PARAM_WITH_DEFAU
593
593
#ifdef CPP2_NO_RTTI
594
594
// Compile-Time type name deduction for -fno-rtti builds
595
595
//
596
-
597
- auto process_type_name (std::string_view name) -> std::string_view {
596
+ constexpr auto process_type_name (std::string_view name) -> std::string_view {
598
597
#if defined(__clang__) || defined(__GNUC__)
599
598
constexpr auto type_prefix = std::string_view (" T = " );
600
599
constexpr auto types_close_parenthesis = ' ]' ;
@@ -625,14 +624,15 @@ auto process_type_name(std::string_view name) -> std::string_view {
625
624
}
626
625
627
626
template <typename T>
628
- auto type_name () -> std::string_view {
627
+ constexpr auto type_name () -> std::string_view {
629
628
#if defined(__clang__) || defined(__GNUC__)
630
- return process_type_name (__PRETTY_FUNCTION__);
629
+ constexpr auto ret = process_type_name (__PRETTY_FUNCTION__);
631
630
#elif defined(_MSC_VER)
632
- return process_type_name (__FUNCSIG__);
631
+ constexpr auto ret = process_type_name (__FUNCSIG__);
633
632
#else
634
- return " <cannot determine type>" ;
633
+ constexpr auto ret = " <cannot determine type>" ;
635
634
#endif
635
+ return ret;
636
636
}
637
637
638
638
#endif
@@ -654,7 +654,7 @@ auto type_name() -> std::string_view {
654
654
655
655
[[noreturn]] auto Throw (auto && x, [[maybe_unused]] char const * msg) -> void {
656
656
#ifdef CPP2_NO_EXCEPTIONS
657
- auto err = std::string{" Attempted to throw exception with type \" " };
657
+ auto err = std::string{" Attempted to throw (-fno- exception) type \" " };
658
658
659
659
#ifdef CPP2_NO_RTTI
660
660
err += type_name<decltype (x)>();
0 commit comments