[RISCV] Simplify usage of SplatPat_simm5_plus1. NFC (#125340)
[llvm-project.git] / clang / test / SemaCXX / Inputs / source-location-file.h
blob9ca979d40f8cebe279f4374641f2aa746c457e7a
2 // NOTE: source_location.cpp must include this file after defining
3 // std::source_location.
4 namespace source_location_file {
6 constexpr const char *FILE = __FILE__;
7 constexpr const char *FILE_NAME = __FILE_NAME__;
9 constexpr SL global_info = SL::current();
10 constexpr const char *global_info_filename = __builtin_FILE_NAME();
12 constexpr SL test_function(SL v = SL::current()) {
13 return v;
16 constexpr SL test_function_indirect() {
17 return test_function();
20 constexpr const char *test_function_filename(
21 const char *file_name = __builtin_FILE_NAME()) {
22 return file_name;
25 constexpr const char *test_function_filename_indirect() {
26 return test_function_filename();
29 template <class T, class U = SL>
30 constexpr U test_function_template(T, U u = U::current()) {
31 return u;
34 template <class T, class U = SL>
35 constexpr U test_function_template_indirect(T t) {
36 return test_function_template(t);
39 template <class T, class U = const char *>
40 constexpr U test_function_filename_template(T, U u = __builtin_FILE_NAME()) {
41 return u;
44 template <class T, class U = const char *>
45 constexpr U test_function_filename_template_indirect(T t) {
46 return test_function_filename_template(t);
49 struct TestClass {
50 SL info = SL::current();
51 const char *info_file_name = __builtin_FILE_NAME();
52 SL ctor_info;
53 const char *ctor_info_file_name = nullptr;
54 TestClass() = default;
55 constexpr TestClass(int, SL cinfo = SL::current(),
56 const char *cfile_name = __builtin_FILE_NAME()) :
57 ctor_info(cinfo), ctor_info_file_name(cfile_name) {}
58 template <class T, class U = SL>
59 constexpr TestClass(int, T, U u = U::current(),
60 const char *cfile_name = __builtin_FILE_NAME()) :
61 ctor_info(u), ctor_info_file_name(cfile_name) {}
64 template <class T = SL>
65 struct AggrClass {
66 int x;
67 T info;
68 T init_info = T::current();
69 const char *init_info_file_name = __builtin_FILE_NAME();
72 } // namespace source_location_file