blob: 9252ef9dfa652ce1e17620af8aaa45d3072bd277 [file] [log] [blame]
// Test that char8_t does not alias with other types when -fchar8_t is enabled.
// { dg-do compile }
// { dg-options "-fstrict-aliasing -Wstrict-aliasing=1 -fchar8_t" }
extern long l;
char8_t* f() {
return (char8_t*)&l; // { dg-warning "dereferencing type-punned pointer might break strict-aliasing rules" "char8_t" }
}