| 1 | // { dg-do compile { target c++20 } } |
| 2 | // { dg-require-effective-target cxx11_abi } |
| 3 | |
| 4 | #include <string> |
| 5 | #include <testsuite_hooks.h> |
| 6 | |
| 7 | constexpr bool |
| 8 | test_literals() |
| 9 | { |
| 10 | using namespace std::literals; |
| 11 | |
| 12 | auto s = "narrow string"s; |
| 13 | auto sw = L"wide string"s; |
| 14 | auto s8 = u8"UTF-8 string"s; |
| 15 | auto su = u"UTF-16 string"s; |
| 16 | auto sU = U"UTF-32 string"s; |
| 17 | |
| 18 | return !s.empty() && !sw.empty() && !s8.empty() && !su.empty() && !sU.empty(); |
| 19 | } |
| 20 | |
| 21 | static_assert( test_literals() ); |