blob: 0d6df34d23f0118fafdd407159b81ebd1aad51d3 [file] [log] [blame]
// Test for unsignedness and that the max limit of char8_t is at least 0xFF
// when -fchar8_t is enabled.
// { dg-do compile }
// { dg-options "-std=c++17 -fchar8_t" }
static_assert(u8'\xFF' == 0xFF, "Error");
static_assert(u8"\xFF"[0] == 0xFF, "Error");
static_assert(char8_t(-1) >= 0, "Error");
static_assert(char8_t{-1} >= 0, "Error"); // { dg-error "narrowing conversion of .-1. from .int. to .char8_t." "char8_t" }