Daily bump.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / udlit-embed-quote.C
blobddadef48a92ee6dd752c8d4cb52d4046e0c37e3c
1 // { dg-do run { target c++11 } }
2 // { dg-skip-if "requires hosted libstdc++ for cassert" { ! hostedlib } }
4 //  Make sure embedded quotes are not a problem for string and char literals.
6 #include <cstdint>
7 #include <cassert>
9 int operator ""_embedchar(char)
10 { return 41; }
12 int operator ""_embedstr(const char*, std::size_t len)
13 { return 42 + len; }
15 void
16 test()
18   int i = '\''_embedchar;
20   int j = "\""_embedstr;
21   assert(j == 43);
23   int k = "foo\""_embedstr;
24   assert(k == 46);
26   int l = "\"bar"_embedstr;
27   assert(l == 46);
30 int
31 main()
33   test();