Affected subclause: [dcl.init.string]
Change: UTF-8 string literals may initialize arrays of
char or
unsigned char. Rationale: Compatibility with previously written code that conformed to previous versions of this document
. Effect on original feature: Arrays of
char or
unsigned char
may now be initialized with a UTF-8 string literal
. This can affect initialization that includes arrays
that are directly initialized within class types, typically aggregates
. For example:
struct A {
char8_t s[10];
};
struct B {
char s[10];
};
void f(A);
void f(B);
int main() {
f({u8""});
}