Fix PR c++/21323: GDB thinks char16_t and char32_t are signed in C++
[deliverable/binutils-gdb.git] / gdb / dwarf2read.c
index 966e1ee81ba99a17f96b095c19a5d14485f84af9..e390b322978accacee4edf84cd82ea49eb79a116 100644 (file)
@@ -15125,9 +15125,22 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
          type = init_integer_type (objfile, bits, 1, name);
        break;
       case DW_ATE_UTF:
-       /* We just treat this as an integer and then recognize the
-          type by name elsewhere.  */
-       type = init_integer_type (objfile, bits, 0, name);
+       {
+         gdbarch *arch = get_objfile_arch (objfile);
+
+         if (bits == 16)
+           type = builtin_type (arch)->builtin_char16;
+         else if (bits == 32)
+           type = builtin_type (arch)->builtin_char32;
+         else
+           {
+             complaint (&symfile_complaints,
+                        _("unsupported DW_ATE_UTF bit size: '%d'"),
+                        bits);
+             type = init_integer_type (objfile, bits, 1, name);
+           }
+         return set_die_type (die, type, cu);
+       }
        break;
 
       default:
This page took 0.032213 seconds and 4 git commands to generate.