This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
libstdc++/8716
- From: Phil Edwards <phil at jaj dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 28 Nov 2002 16:28:29 -0500
- Subject: libstdc++/8716
As Paolo mentioned, the fix for 8347 also fixes 8716, which is a QoI
situation in the face of undefined behavior. It also makes for a nice
testcase, since the situation for 8716 doesn't /look/ like that for 8247.
Tested x868/linux, committed to trunk.
2002-11-28 Phil Edwards <pme@gcc.gnu.org>
PR libstdc++/8716
* testsuite/21_strings/ctor_copy_dtor.cc (test05): Also test
the NULL-pointer, zero-size case.
Index: testsuite/21_strings/ctor_copy_dtor.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/21_strings/ctor_copy_dtor.cc,v
retrieving revision 1.11
diff -u -3 -p -r1.11 ctor_copy_dtor.cc
--- testsuite/21_strings/ctor_copy_dtor.cc 27 Oct 2002 07:35:06 -0000 1.11
+++ testsuite/21_strings/ctor_copy_dtor.cc 28 Nov 2002 21:27:02 -0000
@@ -222,6 +222,10 @@ void test05()
std::vector<char> empty;
std::string empty2(empty.begin(), empty.end());
+
+ // libstdc++/8716 (same underlying situation, same fix)
+ char const * s = NULL;
+ std::string zero_length_built_with_NULL(s,0);
}
int main()