1 | //===----------------------------------------------------------------------===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | // <cwchar> |
10 | |
11 | // XFAIL: no-wide-characters |
12 | |
13 | // Tests that include ordering does not affect the definition of wcsstr. |
14 | // See: https://llvm.org/PR62638 |
15 | |
16 | // clang-format off |
17 | #include <iosfwd> |
18 | #include <cwchar> |
19 | // clang-format on |
20 | |
21 | void func() { |
22 | wchar_t* v1; |
23 | const wchar_t* cv2 = L"/" ; |
24 | v1 = wcsstr(haystack: cv2, needle: L"/" ); // expected-error {{assigning to 'wchar_t *' from 'const wchar_t *' discards qualifiers}} |
25 | } |
26 | |