Fixed name demangling for cvr_saved types

This commit is contained in:
Antony Polukhin
2013-10-17 10:28:49 +04:00
parent 5c4082cddf
commit 65953f8793
3 changed files with 7 additions and 2 deletions

View File

@@ -184,13 +184,12 @@ public:
return ret;
}
pos += sizeof("boost::detail::cvr_saver<");
pos += sizeof("boost::detail::cvr_saver<") - 1;
while (ret[pos] == ' ') {
++ pos;
}
std::string::size_type end = ret.rfind(">");
BOOST_ASSERT(end != std::string::npos);
-- end;
while (ret[end] == ' ') {
-- end;
}

View File

@@ -135,6 +135,8 @@ static void test_storing_nonstoring_modifiers_templ() {
BOOST_CHECK(t1 >= t2);
BOOST_CHECK(t2 <= t1);
BOOST_CHECK(t2 >= t1);
BOOST_CHECK_EQUAL(t2.name_demangled(), t1.name_demangled());
}
BOOST_AUTO_TEST_CASE(template_id_storing_modifiers_vs_nonstoring)
@@ -146,6 +148,7 @@ BOOST_AUTO_TEST_CASE(template_id_storing_modifiers_vs_nonstoring)
boost::template_index t1 = boost::template_id_with_cvr<const int>();
boost::template_index t2 = boost::template_id<int>();
BOOST_CHECK_NE(t2, t1);
BOOST_CHECK(t1.name_demangled() == "const int" || t1.name_demangled() == "int const");
}
BOOST_AUTO_TEST_CASE(template_index_stream_operator_via_lexical_cast_testing)

View File

@@ -185,6 +185,8 @@ static void test_storing_nonstoring_modifiers() {
BOOST_CHECK(t1 >= t2);
BOOST_CHECK(t2 <= t1);
BOOST_CHECK(t2 >= t1);
BOOST_CHECK_EQUAL(t2.name_demangled(), t1.name_demangled());
}
BOOST_AUTO_TEST_CASE(type_id_storing_modifiers_vs_nonstoring)
@@ -196,6 +198,7 @@ BOOST_AUTO_TEST_CASE(type_id_storing_modifiers_vs_nonstoring)
boost::type_index t1 = boost::type_id_with_cvr<const int>();
boost::type_index t2 = boost::type_id<int>();
BOOST_CHECK_NE(t2, t1);
BOOST_CHECK(t1.name_demangled() == "const int" || t1.name_demangled() == "int const");
}
BOOST_AUTO_TEST_CASE(type_index_stream_operator_via_lexical_cast_testing)