]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/21_strings/c_strings/char/3_neg.cc
3124fee0e7c07ca1f82d6d1466a7b88321ac78c2
1 // { dg-do compile { target correct_iso_cpp_string_wchar_protos } }
2 // { dg-options "-O2" }
4 // Copyright (C) 2009-2014 Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING3. If not see
19 // <http://www.gnu.org/licenses/>.
23 const char *cc1
, *cc2
;
25 const void *cv1
, *cv2
;
31 v1
= std::memchr (v2
, '/', 3);
32 c1
= std::strchr (c2
, '/');
33 c1
= std::strrchr (c2
, 'c');
34 c1
= std::strpbrk (c2
, "abc");
35 c1
= std::strstr (c2
, "abc");
37 cv1
= std::memchr (v2
, '/', 3);
38 cc1
= std::strchr (c2
, '/');
39 cc1
= std::strrchr (c2
, 'c');
40 cc1
= std::strpbrk (c2
, "abc");
41 cc1
= std::strstr (c2
, "abc");
43 v1
= std::memchr (cv2
, '/', 3); // { dg-error "invalid conversion" }
44 c1
= std::strchr (cc2
, '/'); // { dg-error "invalid conversion" }
45 c1
= std::strrchr (cc2
, 'c'); // { dg-error "invalid conversion" }
46 c1
= std::strpbrk (cc2
, "abc"); // { dg-error "invalid conversion" }
47 c1
= std::strstr (cc2
, "abc"); // { dg-error "invalid conversion" }
49 cv1
= std::memchr (cv2
, '/', 3);
50 cc1
= std::strchr (cc2
, '/');
51 cc1
= std::strrchr (cc2
, 'c');
52 cc1
= std::strpbrk (cc2
, "abc");
53 cc1
= std::strstr (cc2
, "abc");