Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/udlit-implicit-conv-neg-char8_t.C

raw
1 // { dg-options "-std=c++17 -fchar8_t" }
2
3 #include <cstdint>
4
5 int operator ""_bar (long double);
6
7 double operator ""_foo (long long unsigned);
8
9 int i = 12_bar; // { dg-error "unable to find numeric literal operator|with|argument" }
10
11 double d = 1.2_foo; // { dg-error "unable to find numeric literal operator|with|argument" }
12
13 int operator ""_char(char);
14
15 int operator ""_char8_t(char8_t);
16
17 int operator ""_wchar_t(wchar_t);
18
19 int operator ""_char16_t(char16_t);
20
21 int operator ""_char32_t(char32_t);
22
23 int cwcx = 'c'_wchar_t; // { dg-error "unable to find character literal operator|with|argument" }
24 int cc8 = 'c'_char8_t; // { dg-error "unable to find character literal operator|with|argument" }
25 int cc16 = 'c'_char16_t; // { dg-error "unable to find character literal operator|with|argument" }
26 int cc32 = 'c'_char32_t; // { dg-error "unable to find character literal operator|with|argument" }
27
28 int wccx = L'c'_char; // { dg-error "unable to find character literal operator|with|argument" }
29 int wcc8 = L'c'_char8_t; // { dg-error "unable to find character literal operator|with|argument" }
30 int wcc16 = L'c'_char16_t; // { dg-error "unable to find character literal operator|with|argument" }
31 int wcc32 = L'c'_char32_t; // { dg-error "unable to find character literal operator|with|argument" }
32
33 int c8c = u8'c'_char; // { dg-error "unable to find character literal operator|with|argument" }
34 int c8wc = u8'c'_wchar_t; // { dg-error "unable to find character literal operator|with|argument" }
35 int c8c16 = u8'c'_char16_t; // { dg-error "unable to find character literal operator|with|argument" }
36 int c8c32 = u8'c'_char32_t; // { dg-error "unable to find character literal operator|with|argument" }
37
38 int c16c = u'c'_char; // { dg-error "unable to find character literal operator|with|argument" }
39 int c16c8 = u'c'_char8_t; // { dg-error "unable to find character literal operator|with|argument" }
40 int c16wc = u'c'_wchar_t; // { dg-error "unable to find character literal operator|with|argument" }
41 int c16c32 = u'c'_char32_t; // { dg-error "unable to find character literal operator|with|argument" }
42
43 int c32c = U'c'_char; // { dg-error "unable to find character literal operator|with|argument" }
44 int c32c8 = U'c'_char8_t; // { dg-error "unable to find character literal operator|with|argument" }
45 int c32wc = U'c'_wchar_t; // { dg-error "unable to find character literal operator|with|argument" }
46 int c32c16 = U'c'_char16_t; // { dg-error "unable to find character literal operator|with|argument" }
47
48 int operator ""_char_str(const char*, std::size_t);
49
50 int operator ""_wchar_t_str(const wchar_t*, std::size_t);
51
52 int operator ""_char8_t_str(const char8_t*, std::size_t);
53
54 int operator ""_char16_t_str(const char16_t*, std::size_t);
55
56 int operator ""_char32_t_str(const char32_t*, std::size_t);
57
58 int strwstr = "str"_wchar_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
59 int strstr8 = "str"_char8_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
60 int strstr16 = "str"_char16_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
61 int strstr32 = "str"_char32_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
62
63 int str8str = u8"str"_char_str; // { dg-error "unable to find string literal operator|with|arguments" }
64 int str8wstr = u8"str"_wchar_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
65 int str8str16 = u8"str"_char16_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
66 int str8str32 = u8"str"_char32_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
67
68 int wstrstr = L"str"_char_str; // { dg-error "unable to find string literal operator|with|arguments" }
69 int wstrstr8 = L"str"_char8_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
70 int wstrstr16 = L"str"_char16_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
71 int wstrstr32 = L"str"_char32_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
72
73 int str16str = u"str"_char_str; // { dg-error "unable to find string literal operator|with|arguments" }
74 int str16wstr = u"str"_wchar_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
75 int str16str8 = u"str"_char8_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
76 int str16str32 = u"str"_char32_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
77
78 int str32str = U"str"_char_str; // { dg-error "unable to find string literal operator|with|arguments" }
79 int str32wstr = U"str"_wchar_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
80 int str32str8 = U"str"_char8_t_str; // { dg-error "unable to find string literal operator string operator|with|arguments" }
81 int str32str16 = U"str"_char16_t_str; // { dg-error "unable to find string literal operator string operator|with|arguments" }