]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/3_neg.cc
1 // { dg-do compile { target correct_iso_cpp_string_wchar_protos } }
2 // { dg-options "-O2" }
4 // Copyright (C) 2009-2022 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 wchar_t *cw1
, *cw2
;
29 w1
= wmemchr (w2
, L
'/', 3);
30 w1
= wcschr (w2
, L
'/');
31 w1
= wcspbrk (w2
, L
"abc");
32 w1
= wcsrchr (w2
, L
'c');
33 w1
= wcsstr (w2
, L
"abc");
35 cw1
= wmemchr (w2
, L
'/', 3);
36 cw1
= wcschr (w2
, L
'/');
37 cw1
= wcspbrk (w2
, L
"abc");
38 cw1
= wcsrchr (w2
, L
'c');
39 cw1
= wcsstr (w2
, L
"abc");
41 w1
= wmemchr (cw2
, L
'/', 3); // { dg-error "invalid conversion" }
42 w1
= wcschr (cw2
, L
'/'); // { dg-error "invalid conversion" }
43 w1
= wcsrchr (cw2
, L
'c'); // { dg-error "invalid conversion" }
44 w1
= wcspbrk (cw2
, L
"abc"); // { dg-error "invalid conversion" }
45 w1
= wcsstr (cw2
, L
"abc"); // { dg-error "invalid conversion" }
47 cw1
= wmemchr (cw2
, L
'/', 3);
48 cw1
= wcschr (cw2
, L
'/');
49 cw1
= wcspbrk (cw2
, L
"abc");
50 cw1
= wcsrchr (cw2
, L
'c');
51 cw1
= wcsstr (cw2
, L
"abc");