diff --git a/stl/inc/typeinfo b/stl/inc/typeinfo index e1e50f05eb8..f404bdd60bf 100644 --- a/stl/inc/typeinfo +++ b/stl/inc/typeinfo @@ -22,6 +22,8 @@ _STL_DISABLE_CLANG_WARNINGS #include +_EXPORT_STD extern "C++" class type_info; // for typeid, MSVC looks for type_info in the global namespace + _STD_BEGIN // size in pointers of std::function and std::any (roughly 3 pointers larger than std::string when building debug) diff --git a/tests/std/include/test_header_units_and_modules.hpp b/tests/std/include/test_header_units_and_modules.hpp index 33fc4115a77..ce362844dc7 100644 --- a/tests/std/include/test_header_units_and_modules.hpp +++ b/tests/std/include/test_header_units_and_modules.hpp @@ -937,6 +937,8 @@ void test_typeinfo() { const type_info& t3 = typeid(double); assert(t1 == t2); assert(t1 != t3); + + assert(typeid(double).name() == "double"sv); // also test DevCom-10349749 } void test_unordered_map() {