This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Tighten length error check in string::replace
> +void
> +test05()
> +{
bool test = true;
> + std::string str01 = "beyond skin";
> + std::string str02 = "glam";
> +
> + try {
> + str01.replace(8, 7, str02.c_str(), str02.max_size() - 4);
> + }
> + catch(std::length_error& fail) {
> + VERIFY( std::string(fail.what()) == "basic_string::replace" );
> + }
> + catch(...) {
> + VERIFY( false );
> + }
> +}
Is this really correct behavior, to throw length_error here? I'm
uncertain.
-benjamin