xref: /llvm-project/libcxx/test/support/wide_temp_file.h (revision bc8f007fe045139dde244b2374b851f93cc7ed3c)
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 #ifndef TEST_SUPPORT_WIDE_TEMP_FILE_H
10 #define TEST_SUPPORT_WIDE_TEMP_FILE_H
11 
12 #include <codecvt>
13 #include <locale>
14 #include <string>
15 
16 #include "platform_support.h"
17 #include "test_macros.h"
18 
19 TEST_DIAGNOSTIC_PUSH
20 TEST_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
21 TEST_GCC_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
get_wide_temp_file_name()22 inline std::wstring get_wide_temp_file_name() {
23     return std::wstring_convert<std::codecvt_utf8_utf16<wchar_t> >().from_bytes(get_temp_file_name());
24 }
25 TEST_DIAGNOSTIC_POP
26 
27 #endif // TEST_SUPPORT_WIDE_TEMP_FILE_H
28