]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/g++.dg/cpp0x/udlit-embed-quote.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / udlit-embed-quote.C
1 // { dg-do run { target c++11 } }
2
3 // Make sure embedded quotes are not a problem for string and char literals.
4
5 #include <cstdint>
6 #include <cassert>
7
8 int operator"" _embedchar(char)
9 { return 41; }
10
11 int operator"" _embedstr(const char*, std::size_t len)
12 { return 42 + len; }
13
14 void
15 test()
16 {
17 int i = '\''_embedchar;
18
19 int j = "\""_embedstr;
20 assert(j == 43);
21
22 int k = "foo\""_embedstr;
23 assert(k == 46);
24
25 int l = "\"bar"_embedstr;
26 assert(l == 46);
27 }
28
29 int
30 main()
31 {
32 test();
33 }
This page took 0.040148 seconds and 5 git commands to generate.