aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lambda.c
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-06-15 17:47:55 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2018-06-15 17:47:55 +0100
commit36eec25a6fa7c32e36d7f77f85c8acb7ff38a66b (patch)
tree5141ae4527a55652b497904a61bf3dc2f23ff62a /gcc/cp/lambda.c
parent3438bf7b9f5ce1cfbb7e2419da25e72f109ea480 (diff)
downloadgcc-36eec25a6fa7c32e36d7f77f85c8acb7ff38a66b.zip
gcc-36eec25a6fa7c32e36d7f77f85c8acb7ff38a66b.tar.gz
gcc-36eec25a6fa7c32e36d7f77f85c8acb7ff38a66b.tar.bz2
Decorate string_view members with nonnull attribute
The C++ committee has confirmed that passing a null pointer to the unary basic_string_view constructor is undefined. This removes the check from our implementation, and adds the nonnull attribute to warn when the compiler can detect undefined input. * include/std/string_view (basic_string_view(const CharT*)): Remove check for null pointer and add nonnull attribute. (compare(const CharT*), compare(size_type, size_type, const CharT*)) (find(const CharT*, size_type), rfind(const CharT*, size_type)) (find_first_of(const CharT*, size_type)) (find_last_of(const CharT*, size_type)) (find_first_not_of(const CharT*, size_type)) (find_last_not_of(const CharT*, size_type)): Add nonnull attribute. * testsuite/21_strings/basic_string_view/cons/char/nonnull.cc: New. * testsuite/21_strings/basic_string_view/operations/compare/char/ nonnull.cc: New. * testsuite/21_strings/basic_string_view/operations/find/char/ nonnull.cc: New. * testsuite/21_strings/basic_string_view/operations/rfind/char/ nonnull.cc: New. From-SVN: r261638
Diffstat (limited to 'gcc/cp/lambda.c')
0 files changed, 0 insertions, 0 deletions