]> gcc.gnu.org Git - gcc.git/blob - libstdc++-v3/testsuite/21_strings/basic_string_view/operations/contains/nonnull.cc
libstdc++: Add nonnull to starts_with/ends_with/contains string members
[gcc.git] / libstdc++-v3 / testsuite / 21_strings / basic_string_view / operations / contains / nonnull.cc
1 // { dg-options "-std=gnu++23 -Wnonnull -O0" }
2 // { dg-do compile { target c++23 } }
3
4 #include <string_view>
5
6 void
7 test01(std::string_view s)
8 {
9 s.contains((const char*)nullptr); // { dg-warning "\\\[-Wnonnull" }
10 s.contains((char*)nullptr); // { dg-warning "\\\[-Wnonnull" }
11 s.contains(nullptr); // { dg-warning "\\\[-Wnonnull" }
12 }
This page took 0.033644 seconds and 5 git commands to generate.