comparison gcc/testsuite/g++.dg/cpp0x/udlit-implicit-conv-neg.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 // { dg-do compile { target c++11 } }
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"" _wchar_t(wchar_t);
16
17 int operator"" _char16_t(char16_t);
18
19 int operator"" _char32_t(char32_t);
20
21 int cwcx = 'c'_wchar_t; // { dg-error "unable to find character literal operator|with|argument" }
22 int cc16 = 'c'_char16_t; // { dg-error "unable to find character literal operator|with|argument" }
23 int cc32 = 'c'_char32_t; // { dg-error "unable to find character literal operator|with|argument" }
24
25 int wccx = L'c'_char; // { dg-error "unable to find character literal operator|with|argument" }
26 int wcc16 = L'c'_char16_t; // { dg-error "unable to find character literal operator|with|argument" }
27 int wcc32 = L'c'_char32_t; // { dg-error "unable to find character literal operator|with|argument" }
28
29 int c16c = u'c'_char; // { dg-error "unable to find character literal operator|with|argument" }
30 int c16wc = u'c'_wchar_t; // { dg-error "unable to find character literal operator|with|argument" }
31 int c16c32 = u'c'_char32_t; // { dg-error "unable to find character literal operator|with|argument" }
32
33 int c32c = U'c'_char; // { dg-error "unable to find character literal operator|with|argument" }
34 int c32wc = U'c'_wchar_t; // { dg-error "unable to find character literal operator|with|argument" }
35 int c32c16 = U'c'_char16_t; // { dg-error "unable to find character literal operator|with|argument" }
36
37 int operator"" _char_str(const char*, std::size_t);
38
39 int operator"" _wchar_t_str(const wchar_t*, std::size_t);
40
41 int operator"" _char16_t_str(const char16_t*, std::size_t);
42
43 int operator"" _char32_t_str(const char32_t*, std::size_t);
44
45 int strwstr = "str"_wchar_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
46 int strstr16 = "str"_char16_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
47 int strstr32 = "str"_char32_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
48
49 int str8wstr = u8"str"_wchar_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
50 int str8str16 = u8"str"_char16_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
51 int str8str32 = u8"str"_char32_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
52
53 int wstrstr = L"str"_char_str; // { dg-error "unable to find string literal operator|with|arguments" }
54 int wstrstr16 = L"str"_char16_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
55 int wstrstr32 = L"str"_char32_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
56
57 int str16str = u"str"_char_str; // { dg-error "unable to find string literal operator|with|arguments" }
58 int str16wstr = u"str"_wchar_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
59 int str16str32 = u"str"_char32_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
60
61 int str32str = U"str"_char_str; // { dg-error "unable to find string literal operator|with|arguments" }
62 int str32wstr = U"str"_wchar_t_str; // { dg-error "unable to find string literal operator|with|arguments" }
63 int str32str16 = U"str"_char16_t_str; // { dg-error "unable to find string literal operator string operator|with|arguments" }