re PR libstdc++/65049 (Undefined behaviour with std::char_traits<char>)
authorJonathan Wakely <jwakely@redhat.com>
Mon, 24 Aug 2015 13:43:54 +0000 (14:43 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 24 Aug 2015 13:43:54 +0000 (14:43 +0100)
commit4a88769c966c56816200b2ca128f7e66ce35862f
tree9e2a0e196c68f7e5f03acc5d9aa61d64c76e3700
parent3af7efb7d966228f55664175c029d02d21b69873
re PR libstdc++/65049 (Undefined behaviour with std::char_traits<char>)

PR libstdc++/65049
* include/bits/char_traits.h (char_traits<char>::compare,
char_traits<char>::find, char_traits<char>::move,
char_traits<char>::copy, char_traits<char>::assign): Check for zero
length.
(char_traits<wchar_t>::compare, char_traits<wchar_t>::find,
char_traits<wchar_t>::move, char_traits<wchar_t>::copy,
char_traits<wchar_t>::assign): Likewise.
(char_traits<char16_t>::move, char_traits<char16_t>::copy): Likewise.
(char_traits<char32_t>::move, char_traits<char32_t>::copy): Likewise.
* include/ext/pod_char_traits.h (char_traits<character<>>::move,
char_traits<character<>>::copy): Likewise.
* testsuite/21_strings/char_traits/requirements/char/65049.cc: New.
* testsuite/21_strings/char_traits/requirements/char16_t/65049.cc:
New.
* testsuite/21_strings/char_traits/requirements/char32_t/65049.cc:
New.
* testsuite/21_strings/char_traits/requirements/wchar_t/65049.cc:
New.

From-SVN: r227127
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/char_traits.h
libstdc++-v3/include/ext/pod_char_traits.h
libstdc++-v3/testsuite/21_strings/char_traits/requirements/char/65049.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/char_traits/requirements/char16_t/65049.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/char_traits/requirements/char32_t/65049.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/char_traits/requirements/wchar_t/65049.cc [new file with mode: 0644]