While looking at the Rust changes to dwarf2out I noticed that this was
missing from the char8_t support.
gcc/ChangeLog:
* dwarf2out.cc (base_type_die): Also use DW_ATE_UTF for char8_t.
gcc/testsuite/ChangeLog:
* g++.dg/debug/dwarf2/utf-1.C: New test.
{
const char *name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
if (strcmp (name, "char16_t") == 0
+ || strcmp (name, "char8_t") == 0
|| strcmp (name, "char32_t") == 0)
{
encoding = DW_ATE_UTF;
--- /dev/null
+// { dg-do compile { target c++20 } }
+// { dg-options { -gdwarf -dA } }
+
+// Test that all three use DW_ATE_UTF.
+// { dg-final { scan-assembler-times {DW_AT_encoding \(0x10\)} 3 } }
+
+char8_t c8;
+char16_t c16;
+char32_t c32;