Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/udlit-operator-neg.C

raw
1 // { dg-do compile { target c++11 } }
2
3 // Can't have *both* literal operator template and raw literal operator.
4
5 int
6 operator ""_abc(const char*)
7 {
8 return 42;
9 }
10
11 template<char...>
12 int
13 operator ""_abc() // { dg-error "literal operator template|conflicts with raw literal operator" }
14 {
15 return 13;
16 }
17
18 template<char...>
19 int
20 operator ""_def()
21 {
22 return 12;
23 }
24
25 int
26 operator ""_def(const char*) // { dg-error "raw literal operator|conflicts with literal operator template" }
27 {
28 return 43;
29 }
30
31 int
32 operator ""_ghi(long double)
33 {
34 return 42;
35 }
36
37 template<char...>
38 int
39 operator ""_ghi() // OK
40 {
41 return 13;
42 }