summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/utf8.C
blob: 52816f8591835b5ac0bca5792d6f1d09872e4c99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// { dg-do compile }
// { dg-options "-std=c++1z" }

#include <cassert>
#include <experimental/type_traits>

auto c = 'c';
auto u8c = u8'c';

static_assert(std::experimental::is_same_v<decltype(u8c), decltype(c)>, "");

auto u8s = u8"c";
auto x = u8s[0];

static_assert(std::experimental::is_same_v<decltype(u8c), decltype(x)>, "");