]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove gdb_static_assert
authorTom Tromey <tom@tromey.com>
Thu, 19 Oct 2023 02:44:11 +0000 (20:44 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 29 Nov 2023 21:29:44 +0000 (14:29 -0700)
C++17 makes the second parameter to static_assert optional, so we can
remove gdb_static_assert now.

50 files changed:
gdb/aarch64-linux-nat.c
gdb/aarch64-tdep.c
gdb/addrmap.c
gdb/alpha-tdep.c
gdb/arc-linux-tdep.c
gdb/arc-tdep.c
gdb/avr-tdep.c
gdb/bpf-tdep.c
gdb/charset.c
gdb/command.h
gdb/cris-tdep.c
gdb/defs.h
gdb/disasm.c
gdb/dwarf2/read-gdb-index.c
gdb/dwarf2/read.c
gdb/f-array-walker.h
gdb/ft32-tdep.c
gdb/gdb_bfd.c
gdb/hppa-tdep.c
gdb/iq2000-tdep.c
gdb/linux-tdep.c
gdb/lm32-tdep.c
gdb/m32r-tdep.c
gdb/m68k-tdep.c
gdb/mi/mi-common.c
gdb/microblaze-tdep.c
gdb/moxie-tdep.c
gdb/msp430-tdep.c
gdb/nat/amd64-linux-siginfo.c
gdb/nios2-tdep.c
gdb/remote-notif.c
gdb/riscv-tdep.c
gdb/symfile-mem.c
gdb/symtab.c
gdb/symtab.h
gdb/tilegx-tdep.c
gdb/trad-frame.c
gdb/unittests/enum-flags-selftests.c
gdb/unittests/packed-selftests.c
gdb/v850-tdep.c
gdb/value.c
gdb/vax-tdep.c
gdb/windows-tdep.c
gdb/xstormy16-tdep.c
gdbserver/i387-fp.cc
gdbserver/server.cc
gdbserver/server.h
gdbsupport/gdb_assert.h
gdbsupport/packed.h
gdbsupport/pathstuff.h

index 0e87aaa9b7add4dee5aea44d149c7154a869b07f..5b4e3c2bde14cde06a18badc0f8be2bea376e033 100644 (file)
@@ -137,7 +137,7 @@ fetch_gregs_from_thread (struct regcache *regcache)
 
   /* Make sure REGS can hold all registers contents on both aarch64
      and arm.  */
-  gdb_static_assert (sizeof (regs) >= 18 * 4);
+  static_assert (sizeof (regs) >= 18 * 4);
 
   tid = regcache->ptid ().lwp ();
 
@@ -175,7 +175,7 @@ store_gregs_to_thread (const struct regcache *regcache)
 
   /* Make sure REGS can hold all registers contents on both aarch64
      and arm.  */
-  gdb_static_assert (sizeof (regs) >= 18 * 4);
+  static_assert (sizeof (regs) >= 18 * 4);
   tid = regcache->ptid ().lwp ();
 
   iovec.iov_base = &regs;
@@ -217,7 +217,7 @@ fetch_fpregs_from_thread (struct regcache *regcache)
 
   /* Make sure REGS can hold all VFP registers contents on both aarch64
      and arm.  */
-  gdb_static_assert (sizeof regs >= ARM_VFP3_REGS_SIZE);
+  static_assert (sizeof regs >= ARM_VFP3_REGS_SIZE);
 
   tid = regcache->ptid ().lwp ();
 
@@ -264,7 +264,7 @@ store_fpregs_to_thread (const struct regcache *regcache)
 
   /* Make sure REGS can hold all VFP registers contents on both aarch64
      and arm.  */
-  gdb_static_assert (sizeof regs >= ARM_VFP3_REGS_SIZE);
+  static_assert (sizeof regs >= ARM_VFP3_REGS_SIZE);
   tid = regcache->ptid ().lwp ();
 
   iovec.iov_base = &regs;
index ba37b4969a3010f3c491bf1196bf922d74fc92db..4a7ce68e85a9825098f9ecd58fbacac6a20e9be4 100644 (file)
@@ -3113,7 +3113,7 @@ aarch64_pseudo_read_value_1 (struct gdbarch *gdbarch,
 
   /* Enough space for a full vector register.  */
   gdb_byte reg_buf[register_size (gdbarch, AARCH64_V0_REGNUM)];
-  gdb_static_assert (AARCH64_V0_REGNUM == AARCH64_SVE_Z0_REGNUM);
+  static_assert (AARCH64_V0_REGNUM == AARCH64_SVE_Z0_REGNUM);
 
   if (regcache->raw_read (v_regnum, reg_buf) != REG_VALID)
     result_value->mark_bytes_unavailable (0,
@@ -3323,7 +3323,7 @@ aarch64_pseudo_write_1 (struct gdbarch *gdbarch, struct regcache *regcache,
 
   /* Enough space for a full vector register.  */
   gdb_byte reg_buf[register_size (gdbarch, AARCH64_V0_REGNUM)];
-  gdb_static_assert (AARCH64_V0_REGNUM == AARCH64_SVE_Z0_REGNUM);
+  static_assert (AARCH64_V0_REGNUM == AARCH64_SVE_Z0_REGNUM);
 
   /* Ensure the register buffer is zero, we want gdb writes of the
      various 'scalar' pseudo registers to behavior like architectural
index 076062a0206a3e2adc896320dc3ec7e6be8d397a..b10888008c91da5aac4fe995bc32a879ee04eb49 100644 (file)
@@ -24,8 +24,8 @@
 
 /* Make sure splay trees can actually hold the values we want to
    store in them.  */
-gdb_static_assert (sizeof (splay_tree_key) >= sizeof (CORE_ADDR *));
-gdb_static_assert (sizeof (splay_tree_value) >= sizeof (void *));
+static_assert (sizeof (splay_tree_key) >= sizeof (CORE_ADDR *));
+static_assert (sizeof (splay_tree_value) >= sizeof (void *));
 
 \f
 /* Fixed address maps.  */
index 9fb973597fc434776ee9d01cd1f9e0597799198b..0d3a49550530a6332ba47e71271aa287371ecb1a 100644 (file)
@@ -98,7 +98,7 @@ alpha_register_name (struct gdbarch *gdbarch, int regno)
     "pc",   "",     "unique"
   };
 
-  gdb_static_assert (ALPHA_NUM_REGS == ARRAY_SIZE (register_names));
+  static_assert (ALPHA_NUM_REGS == ARRAY_SIZE (register_names));
   return register_names[regno];
 }
 
index 8c0f7ae3c9545fd9ad8118bb5fdb4cb5b74b2d87..33dabc70d4cc20deec6378f0af205bc738b25b1d 100644 (file)
@@ -549,7 +549,7 @@ arc_linux_supply_gregset (const struct regset *regset,
                          struct regcache *regcache,
                          int regnum, const void *gregs, size_t size)
 {
-  gdb_static_assert (ARC_LAST_REGNUM
+  static_assert (ARC_LAST_REGNUM
                     < ARRAY_SIZE (arc_linux_core_reg_offsets));
 
   const bfd_byte *buf = (const bfd_byte *) gregs;
@@ -612,7 +612,7 @@ arc_linux_collect_gregset (const struct regset *regset,
                           const struct regcache *regcache,
                           int regnum, void *gregs, size_t size)
 {
-  gdb_static_assert (ARC_LAST_REGNUM
+  static_assert (ARC_LAST_REGNUM
                     < ARRAY_SIZE (arc_linux_core_reg_offsets));
 
   gdb_byte *buf = (gdb_byte *) gregs;
index a22b5bff246b3f39a7ce45d4add2ca4575026a2a..44e26ae2c1dfef69972626c0fb3073636d3a2b32 100644 (file)
@@ -344,7 +344,7 @@ arc_insn_get_operand_value_signed (const struct arc_instruction &insn,
       /* Convert unsigned raw value to signed one.  This assumes 2's
         complement arithmetic, but so is the LONG_MIN value from generic
         defs.h and that assumption is true for ARC.  */
-      gdb_static_assert (sizeof (insn.limm_value) == sizeof (int));
+      static_assert (sizeof (insn.limm_value) == sizeof (int));
       return (((LONGEST) insn.limm_value) ^ INT_MIN) - INT_MIN;
     case ARC_OPERAND_KIND_SHIMM:
       /* Sign conversion has been done by binutils.  */
index 598d740883c6cd3c3ebf3ea6d79dd2a198ac92d3..be0601056a80fac12c2f2078b2c34749cc8dda99 100644 (file)
@@ -216,7 +216,7 @@ avr_register_name (struct gdbarch *gdbarch, int regnum)
     "SREG", "SP", "PC2",
     "pc"
   };
-  gdb_static_assert (ARRAY_SIZE (register_names)
+  static_assert (ARRAY_SIZE (register_names)
                     == (AVR_NUM_REGS + AVR_NUM_PSEUDO_REGS));
   return register_names[regnum];
 }
index 97a6d75a68b7e22615b86316b13aeff88a230b71..d2b0d3f7ea250dc1f6021a75f8e1e7e370cfc4ae 100644 (file)
@@ -93,7 +93,7 @@ static const char *bpf_register_names[] =
 static const char *
 bpf_register_name (struct gdbarch *gdbarch, int reg)
 {
-  gdb_static_assert (ARRAY_SIZE (bpf_register_names) == BPF_NUM_REGS);
+  static_assert (ARRAY_SIZE (bpf_register_names) == BPF_NUM_REGS);
   return bpf_register_names[reg];
 }
 
index bce6050c97f5df7cce474aa890f8b4736a9c6f49..ac2613f4c8818f85b63422129d9177778e398b51 100644 (file)
@@ -939,7 +939,7 @@ default_auto_wide_charset (void)
 
 /* GDB cannot handle strings correctly if this size is different.  */
 
-gdb_static_assert (sizeof (gdb_wchar_t) == 2 || sizeof (gdb_wchar_t) == 4);
+static_assert (sizeof (gdb_wchar_t) == 2 || sizeof (gdb_wchar_t) == 4);
 
 /* intermediate_encoding returns the charset used internally by
    GDB to convert between target and host encodings. As the test above
index 1ab953b996b9e1339a2dea7b1d28716a047f215c..9d8495756376479567cfd2a43afb8fb07886af22 100644 (file)
@@ -292,8 +292,8 @@ struct setting
     /* Getters and setters are cast to and from the arbitrary `void (*) ()`
        function pointer type.  Make sure that the two types are really of the
        same size.  */
-    gdb_static_assert (sizeof (m_getter) == sizeof (getter));
-    gdb_static_assert (sizeof (m_setter) == sizeof (setter));
+    static_assert (sizeof (m_getter) == sizeof (getter));
+    static_assert (sizeof (m_setter) == sizeof (setter));
 
     m_getter = reinterpret_cast<erased_func> (getter);
     m_setter = reinterpret_cast<erased_func> (setter);
index 9847516d9b8d7c47ff089a8eecdcdc7fbcf70e6c..783042a920e89fa9a551961efadbe6f0738f3893 100644 (file)
@@ -1669,7 +1669,7 @@ cris_register_name (struct gdbarch *gdbarch, int regno)
   if (regno < NUM_GENREGS)
     {
       /* General register.  */
-      gdb_static_assert (ARRAY_SIZE (cris_genreg_names) == NUM_GENREGS);
+      static_assert (ARRAY_SIZE (cris_genreg_names) == NUM_GENREGS);
       return cris_genreg_names[regno];
     }
   else if (regno >= NUM_GENREGS && regno < gdbarch_num_regs (gdbarch))
index e6dd93e791e30f5899e9d5eb05563df7ff5dd8d3..bcce4f4c3e43e79bc2b47aa96244f653cc5ff4a5 100644 (file)
@@ -229,7 +229,7 @@ enum language
 /* The number of bits needed to represent all languages, with enough
    padding to allow for reasonable growth.  */
 #define LANGUAGE_BITS 5
-gdb_static_assert (nr_languages <= (1 << LANGUAGE_BITS));
+static_assert (nr_languages <= (1 << LANGUAGE_BITS));
 
 /* The number of bytes needed to represent all languages.  */
 #define LANGUAGE_BYTES ((LANGUAGE_BITS + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT)
index 82b7e990ff9d5f863d87b47434a20a21351d76c0..32eabb71af10c6bb2472991c4caaf8864aa2762f 100644 (file)
@@ -1149,7 +1149,7 @@ gdb_disassembler::print_insn (CORE_ADDR memaddr,
             To do this we perform an in-place new, but this time turn on
             the styling support, then we can re-disassembly the
             instruction, and gain any minimal styling GDB might add.  */
-         gdb_static_assert ((std::is_same<decltype (m_buffer),
+         static_assert ((std::is_same<decltype (m_buffer),
                              string_file>::value));
          gdb_assert (!m_buffer.term_out ());
          m_buffer.~string_file ();
index 7788626b67a90f43d3d8fa647b7a3d532416c344..da180fa8a412baa6df7830f561538861b43ef123 100644 (file)
@@ -648,7 +648,7 @@ create_cus_from_gdb_index_list (dwarf2_per_bfd *per_bfd,
 {
   for (offset_type i = 0; i < n_elements; i += 2)
     {
-      gdb_static_assert (sizeof (ULONGEST) >= 8);
+      static_assert (sizeof (ULONGEST) >= 8);
 
       sect_offset sect_off
        = (sect_offset) extract_unsigned_integer (cu_list, 8, BFD_ENDIAN_LITTLE);
@@ -700,7 +700,7 @@ create_signatured_type_table_from_gdb_index
       void **slot;
       cu_offset type_offset_in_tu;
 
-      gdb_static_assert (sizeof (ULONGEST) >= 8);
+      static_assert (sizeof (ULONGEST) >= 8);
       sect_offset sect_off
        = (sect_offset) extract_unsigned_integer (bytes, 8, BFD_ENDIAN_LITTLE);
       type_offset_in_tu
index 468e76dfb34674c251a8053cb14370dd04a6719c..9311666a832bd06daff1fefc14264bcfe3f1b7bc 100644 (file)
@@ -10287,7 +10287,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
 
   /* We never call the destructor of call_site, so we must ensure it is
      trivially destructible.  */
-  gdb_static_assert(std::is_trivially_destructible<struct call_site>::value);
+  static_assert(std::is_trivially_destructible<struct call_site>::value);
 
   if (dwarf2_flag_true_p (die, DW_AT_call_tail_call, cu)
       || dwarf2_flag_true_p (die, DW_AT_GNU_tail_call, cu))
index 569636773f5f4f586f32eabd6cbef69a29e93cde..de40837cce9fbd1750a534d78e69e3b4c86472bd 100644 (file)
@@ -187,7 +187,7 @@ class fortran_array_walker
   /* Ensure that Impl is derived from the required base class.  This just
      ensures that all of the required API methods are available and have a
      sensible default implementation.  */
-  gdb_static_assert ((std::is_base_of<fortran_array_walker_base_impl,Impl>::value));
+  static_assert ((std::is_base_of<fortran_array_walker_base_impl,Impl>::value));
 
 public:
   /* Create a new array walker.  TYPE is the type of the array being walked
index cac4b9ba6a298561c6d314ba859a42bf3c67bd14..8ec0aab0b8853851d08614edf4e7918c13f40c46 100644 (file)
@@ -96,7 +96,7 @@ static const char *const ft32_register_names[] =
 static const char *
 ft32_register_name (struct gdbarch *gdbarch, int reg_nr)
 {
-  gdb_static_assert (ARRAY_SIZE (ft32_register_names) == FT32_NUM_REGS);
+  static_assert (ARRAY_SIZE (ft32_register_names) == FT32_NUM_REGS);
   return ft32_register_names[reg_nr];
 }
 
index b72821f4c3581c5f167799b220ffec575153bdeb..1c496c498ac8917849ad485054a1988314c396b3 100644 (file)
@@ -977,7 +977,7 @@ gdb_bfd_record_inclusion (bfd *includer, bfd *includee)
 
 \f
 
-gdb_static_assert (ARRAY_SIZE (_bfd_std_section) == 4);
+static_assert (ARRAY_SIZE (_bfd_std_section) == 4);
 
 /* See gdb_bfd.h.  */
 
index c9452a1c96d3474c9d4295ab7dda153227a1f824..32793aa93f4f5275a6ed9a5f21012ac5b4e2a390 100644 (file)
@@ -632,7 +632,7 @@ hppa32_register_name (struct gdbarch *gdbarch, int i)
     "fr28",    "fr28R",  "fr29",   "fr29R",
     "fr30",   "fr30R",   "fr31",   "fr31R"
   };
-  gdb_static_assert (ARRAY_SIZE (names) == hppa32_num_regs);
+  static_assert (ARRAY_SIZE (names) == hppa32_num_regs);
   return names[i];
 }
 
@@ -665,7 +665,7 @@ hppa64_register_name (struct gdbarch *gdbarch, int i)
     "fr24",    "fr25",   "fr26",   "fr27",
     "fr28",  "fr29",    "fr30",   "fr31"
   };
-  gdb_static_assert (ARRAY_SIZE (names) == hppa64_num_regs);
+  static_assert (ARRAY_SIZE (names) == hppa64_num_regs);
   return names[i];
 }
 
index d4509f93b74729410f15ac2f53acc543c84c8398..48316e71164d364da44593ef381a5dc063618a40 100644 (file)
@@ -135,7 +135,7 @@ iq2000_register_name (struct gdbarch *gdbarch, int regnum)
       "r30", "r31",
       "pc"
     };
-  gdb_static_assert (ARRAY_SIZE (names) == E_NUM_REGS);
+  static_assert (ARRAY_SIZE (names) == E_NUM_REGS);
   return names[regnum];
 }
 
index 5fd64aa747408721ae8c0672e0a8cded22cc9b88..82e8bc3db3cd7e0d35606316725c5308a0baa66c 100644 (file)
@@ -1129,7 +1129,7 @@ linux_read_core_file_mappings
    read_core_file_mappings_loop_ftype  loop_cb)
 {
   /* Ensure that ULONGEST is big enough for reading 64-bit core files.  */
-  gdb_static_assert (sizeof (ULONGEST) >= 8);
+  static_assert (sizeof (ULONGEST) >= 8);
 
   /* It's not required that the NT_FILE note exists, so return silently
      if it's not found.  Beyond this point though, we'll complain
index 0eecdb6ac40a588fe26e3a1c9bc465858f852332..6744ba96c4ed199640008c610f27bced7b87b7c8 100644 (file)
@@ -91,7 +91,7 @@ lm32_register_name (struct gdbarch *gdbarch, int reg_nr)
     "PC", "EID", "EBA", "DEBA", "IE", "IM", "IP"
   };
 
-  gdb_static_assert (ARRAY_SIZE (register_names) == SIM_LM32_NUM_REGS);
+  static_assert (ARRAY_SIZE (register_names) == SIM_LM32_NUM_REGS);
   return register_names[reg_nr];
 }
 
index ba525998e0c939daca9020c30e1ab9f9d8f80250..dfb2fdfcb66c847cb66e29ecfbfe874388f73525 100644 (file)
@@ -212,7 +212,7 @@ static const char * const m32r_register_names[] = {
 static const char *
 m32r_register_name (struct gdbarch *gdbarch, int reg_nr)
 {
-  gdb_static_assert (ARRAY_SIZE (m32r_register_names) == M32R_NUM_REGS);
+  static_assert (ARRAY_SIZE (m32r_register_names) == M32R_NUM_REGS);
   return m32r_register_names[reg_nr];
 }
 
index 5b2a29a350e53d2a7d366dcfcd95213d57b63897..0b761d019f2a49029b60dc0a6657c75b0d37b128 100644 (file)
@@ -176,7 +176,7 @@ m68k_register_name (struct gdbarch *gdbarch, int regnum)
 {
   m68k_gdbarch_tdep *tdep = gdbarch_tdep<m68k_gdbarch_tdep> (gdbarch);
 
-  gdb_static_assert (ARRAY_SIZE (m68k_register_names) == M68K_NUM_REGS);
+  static_assert (ARRAY_SIZE (m68k_register_names) == M68K_NUM_REGS);
   if (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FPI_REGNUM
       && tdep->fpregs_present == 0)
     return "";
index ce70d11a912845eb9fd465006495c4eb0c7b76db..1c1424ab57d89a8b23bef09c210931161841a085 100644 (file)
@@ -43,7 +43,7 @@ static const char * const async_reason_string_lookup[] =
   NULL
 };
 
-gdb_static_assert (ARRAY_SIZE (async_reason_string_lookup)
+static_assert (ARRAY_SIZE (async_reason_string_lookup)
                   == EXEC_ASYNC_LAST + 1);
 
 const char *
index 74e70405b3a8205f960bf6f6105d868e71eeb697..e975b7cd553095248be2a7576fb24a31f15c0acf 100644 (file)
@@ -92,7 +92,7 @@ static unsigned int microblaze_debug_flag = 0;
 static const char *
 microblaze_register_name (struct gdbarch *gdbarch, int regnum)
 {
-  gdb_static_assert (ARRAY_SIZE (microblaze_register_names)
+  static_assert (ARRAY_SIZE (microblaze_register_names)
                     == MICROBLAZE_NUM_REGS);
   return microblaze_register_names[regnum];
 }
index 600fb060b1e9ced41066e036ddb87008fba17324..14d20be2e38785fd727d1e16cec7ba40e92b2e70 100644 (file)
@@ -81,7 +81,7 @@ static const char * const moxie_register_names[] = {
 static const char *
 moxie_register_name (struct gdbarch *gdbarch, int reg_nr)
 {
-  gdb_static_assert (ARRAY_SIZE (moxie_register_names) == MOXIE_NUM_REGS);
+  static_assert (ARRAY_SIZE (moxie_register_names) == MOXIE_NUM_REGS);
   return moxie_register_names[reg_nr];
 }
 
index f65948f01d8753084efd6d3d588381824b5d163e..c03e12c9486f970ae09e0fecbaaa168e04abd777 100644 (file)
@@ -197,7 +197,7 @@ msp430_register_name (struct gdbarch *gdbarch, int regnr)
     "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
   };
 
-  gdb_static_assert (ARRAY_SIZE (reg_names) == (MSP430_NUM_REGS
+  static_assert (ARRAY_SIZE (reg_names) == (MSP430_NUM_REGS
                                                + MSP430_NUM_PSEUDO_REGS));
   return reg_names[regnr];
 }
index 00bb5e522f4809ba801b5be7283e4e9e133dc82d..0de370d013aa296dc1c9ac749939dfd2b2166515 100644 (file)
@@ -604,10 +604,10 @@ amd64_linux_siginfo_fixup_common (siginfo_t *ptrace, gdb_byte *inf,
 
 /* Sanity check for the siginfo structure sizes.  */
 
-gdb_static_assert (sizeof (siginfo_t) == GDB_SI_SIZE);
+static_assert (sizeof (siginfo_t) == GDB_SI_SIZE);
 #ifndef __ILP32__
-gdb_static_assert (sizeof (nat_siginfo_t) == GDB_SI_SIZE);
+static_assert (sizeof (nat_siginfo_t) == GDB_SI_SIZE);
 #endif
-gdb_static_assert (sizeof (compat_x32_siginfo_t) == GDB_SI_SIZE);
-gdb_static_assert (sizeof (compat_siginfo_t) == GDB_SI_SIZE);
-gdb_static_assert (sizeof (ptrace_siginfo_t) == GDB_SI_SIZE);
+static_assert (sizeof (compat_x32_siginfo_t) == GDB_SI_SIZE);
+static_assert (sizeof (compat_siginfo_t) == GDB_SI_SIZE);
+static_assert (sizeof (ptrace_siginfo_t) == GDB_SI_SIZE);
index 40d65b64b18b2d29f14dba31bb5bc11b80c1ddd8..91c038951136e8a0c095c9158e2a4eb5e8addcf5 100644 (file)
@@ -140,7 +140,7 @@ static int nios2_dwarf2gdb_regno_map[] =
   NIOS2_MPUACC_REGNUM     /* 48 */
 };
 
-gdb_static_assert (ARRAY_SIZE (nios2_dwarf2gdb_regno_map) == NIOS2_NUM_REGS);
+static_assert (ARRAY_SIZE (nios2_dwarf2gdb_regno_map) == NIOS2_NUM_REGS);
 
 /* Implement the dwarf2_reg_to_regnum gdbarch method.  */
 
index dfa1d33a7e1209acec996fa3c917d9a9a61cf52b..997b6e7ae26fc850d3ce9f220667ebf968f9a766 100644 (file)
@@ -51,7 +51,7 @@ static const notif_client *const notifs[] =
   &notif_client_stop,
 };
 
-gdb_static_assert (ARRAY_SIZE (notifs) == REMOTE_NOTIF_LAST);
+static_assert (ARRAY_SIZE (notifs) == REMOTE_NOTIF_LAST);
 
 /* Parse the BUF for the expected notification NC, and send packet to
    acknowledge.  */
index 8849483d4d4eb14f41370f1386ca7de6ad4ed45a..2b4b9e2a02ac3ec61a828639c25442d5a3c91649 100644 (file)
@@ -441,7 +441,7 @@ struct riscv_freg_feature : public riscv_register_feature
      RISCV_LAST_FP_REGNUM.  */
   const char *register_name (int regnum) const
   {
-    gdb_static_assert (RISCV_LAST_FP_REGNUM == RISCV_FIRST_FP_REGNUM + 31);
+    static_assert (RISCV_LAST_FP_REGNUM == RISCV_FIRST_FP_REGNUM + 31);
     gdb_assert (regnum >= RISCV_FIRST_FP_REGNUM
                && regnum <= RISCV_LAST_FP_REGNUM);
     regnum -= RISCV_FIRST_FP_REGNUM;
index 8ec61199d14e8c4e0ff3d33edb117a89393845d4..d35d45c7a86ea695c6bc43c601f9133b57e2a8f0 100644 (file)
@@ -58,9 +58,9 @@
 /* Verify parameters of target_read_memory_bfd and target_read_memory are
    compatible.  */
 
-gdb_static_assert (sizeof (CORE_ADDR) >= sizeof (bfd_vma));
-gdb_static_assert (sizeof (gdb_byte) == sizeof (bfd_byte));
-gdb_static_assert (sizeof (ssize_t) <= sizeof (bfd_size_type));
+static_assert (sizeof (CORE_ADDR) >= sizeof (bfd_vma));
+static_assert (sizeof (gdb_byte) == sizeof (bfd_byte));
+static_assert (sizeof (ssize_t) <= sizeof (bfd_size_type));
 
 /* Provide bfd/ compatible prototype for target_read_memory.  Casting would not
    be enough as LEN width may differ.  */
index 15471554f32618fd355e00af408a6d585be3d504..9fd886c1d69c7cc82581b3373b955b4f5e1f8199 100644 (file)
@@ -6392,7 +6392,7 @@ gdb::array_view<const struct symbol_impl> symbol_impls (symbol_impl);
 
 /* Make sure we saved enough room in struct symbol.  */
 
-gdb_static_assert (MAX_SYMBOL_IMPLS <= (1 << SYMBOL_ACLASS_BITS));
+static_assert (MAX_SYMBOL_IMPLS <= (1 << SYMBOL_ACLASS_BITS));
 
 /* Register a computed symbol type.  ACLASS must be LOC_COMPUTED.  OPS
    is the ops vector associated with this index.  This returns the new
index ec2ac4942d3f1cdcfa467d3b59e91bae5a3ebfb3..c224f479714e6936c12686213d026de44b32db59 100644 (file)
@@ -706,7 +706,7 @@ enum minimal_symbol_type
 /* The number of enum minimal_symbol_type values, with some padding for
    reasonable growth.  */
 #define MINSYM_TYPE_BITS 4
-gdb_static_assert (nr_minsym_types <= (1 << MINSYM_TYPE_BITS));
+static_assert (nr_minsym_types <= (1 << MINSYM_TYPE_BITS));
 
 /* Define a simple structure used to hold some very basic information about
    all defined global symbols (text, data, bss, abs, etc).  The only required
@@ -924,7 +924,7 @@ enum domain_enum
 /* The number of bits in a symbol used to represent the domain.  */
 
 #define SYMBOL_DOMAIN_BITS 3
-gdb_static_assert (NR_DOMAINS <= (1 << SYMBOL_DOMAIN_BITS));
+static_assert (NR_DOMAINS <= (1 << SYMBOL_DOMAIN_BITS));
 
 extern const char *domain_name (domain_enum);
 
@@ -1070,7 +1070,7 @@ enum address_class
    verify that we have reserved enough space for synthetic address
    classes.  */
 #define SYMBOL_ACLASS_BITS 5
-gdb_static_assert (LOC_FINAL_VALUE <= (1 << SYMBOL_ACLASS_BITS));
+static_assert (LOC_FINAL_VALUE <= (1 << SYMBOL_ACLASS_BITS));
 
 /* The methods needed to implement LOC_COMPUTED.  These methods can
    use the symbol's .aux_value for additional per-symbol information.
index 1ec37d45d790172bede4af965886d0679e4c7eac..d2140ad215761b0aa488a659c8afe738d903d31a 100644 (file)
@@ -155,7 +155,7 @@ tilegx_register_name (struct gdbarch *gdbarch, int regnum)
       "pc",   "faultnum",
     };
 
-  gdb_static_assert (TILEGX_NUM_REGS == ARRAY_SIZE (register_names));
+  static_assert (TILEGX_NUM_REGS == ARRAY_SIZE (register_names));
   return register_names[regnum];
 }
 
index 6dc7e9aec66a0dad0e9c61b4b873cb229f5619e8..755d3b963b14d0a566a00fb708a61165ba5b0ded 100644 (file)
@@ -62,7 +62,7 @@ trad_frame_saved_reg *
 trad_frame_alloc_saved_regs (struct gdbarch *gdbarch)
 {
 #ifdef HAVE_IS_TRIVIALLY_CONSTRUCTIBLE
-  gdb_static_assert (std::is_trivially_constructible<trad_frame_saved_reg>::value);
+  static_assert (std::is_trivially_constructible<trad_frame_saved_reg>::value);
 #endif
 
   int numregs = gdbarch_num_cooked_regs (gdbarch);
index 2d3c555d254a52fc37c66bc7c95e578db96a3ebb..460cb7ff29aaf842efd48a3fb5827ebc6ef99492 100644 (file)
@@ -67,7 +67,7 @@ DEF_ENUM_FLAGS_TYPE (URE, UEF);
 
 /* So that std::vectors of types that have enum_flags fields can
    reallocate efficiently memcpy.  */
-gdb_static_assert (std::is_trivially_copyable<EF>::value);
+static_assert (std::is_trivially_copyable<EF>::value);
 
 #endif
 
@@ -407,7 +407,7 @@ self_test ()
   {
     constexpr test_flags f;
 
-    gdb_static_assert (f == 0);
+    static_assert (f == 0);
   }
 
   /* Check that assignment from zero works.  */
@@ -428,16 +428,16 @@ self_test ()
     constexpr test_flags zero3 {0};
     constexpr test_flags zero4 = {0};
 
-    gdb_static_assert (zero1 == 0);
-    gdb_static_assert (zero2 == 0);
-    gdb_static_assert (zero3 == 0);
-    gdb_static_assert (zero4 == 0);
+    static_assert (zero1 == 0);
+    static_assert (zero2 == 0);
+    static_assert (zero3 == 0);
+    static_assert (zero4 == 0);
   }
 
   /* Check construction from enum value.  */
   {
-    gdb_static_assert (test_flags (FLAG1) == FLAG1);
-    gdb_static_assert (test_flags (FLAG2) != FLAG1);
+    static_assert (test_flags (FLAG1) == FLAG1);
+    static_assert (test_flags (FLAG2) != FLAG1);
   }
 
   /* Check copy/assignment.  */
@@ -449,10 +449,10 @@ self_test ()
     constexpr test_flags f3 {src};
     constexpr test_flags f4 = {src};
 
-    gdb_static_assert (f1 == FLAG1);
-    gdb_static_assert (f2 == FLAG1);
-    gdb_static_assert (f3 == FLAG1);
-    gdb_static_assert (f4 == FLAG1);
+    static_assert (f1 == FLAG1);
+    static_assert (f2 == FLAG1);
+    static_assert (f3 == FLAG1);
+    static_assert (f4 == FLAG1);
   }
 
   /* Check moving.  */
@@ -470,7 +470,7 @@ self_test ()
      to test_flags would fail.  */
   {
     constexpr test_flags f = FLAG1 | FLAG2;
-    gdb_static_assert (f == (FLAG1 | FLAG2));
+    static_assert (f == (FLAG1 | FLAG2));
   }
 
   /* Similarly, check that "FLAG1 | FLAG2" on the rhs of an assignment
@@ -492,8 +492,8 @@ self_test ()
     constexpr int some_bits (FLAG1 | FLAG2);
 
     /* And comparison with int works too.  */
-    gdb_static_assert (some_bits == (FLAG1 | FLAG2));
-    gdb_static_assert (some_bits == test_flags (FLAG1 | FLAG2));
+    static_assert (some_bits == (FLAG1 | FLAG2));
+    static_assert (some_bits == test_flags (FLAG1 | FLAG2));
   }
 
   /* Check operator| and operator|=.  Particularly interesting is
@@ -536,7 +536,7 @@ self_test ()
   /* Check the ^/^= operators.  */
   {
     constexpr test_flags f = FLAG1 ^ FLAG2;
-    gdb_static_assert (f == (FLAG1 ^ FLAG2));
+    static_assert (f == (FLAG1 ^ FLAG2));
   }
 
   {
@@ -554,7 +554,7 @@ self_test ()
   {
     constexpr test_uflags f1 = ~UFLAG1;
     constexpr test_uflags f2 = ~f1;
-    gdb_static_assert (f2 == UFLAG1);
+    static_assert (f2 == UFLAG1);
   }
 
   /* Check the ternary operator.  */
@@ -562,18 +562,18 @@ self_test ()
   {
     /* raw enum, raw enum */
     constexpr test_flags f1 = true ? FLAG1 : FLAG2;
-    gdb_static_assert (f1 == FLAG1);
+    static_assert (f1 == FLAG1);
     constexpr test_flags f2 = false ? FLAG1 : FLAG2;
-    gdb_static_assert (f2 == FLAG2);
+    static_assert (f2 == FLAG2);
   }
 
   {
     /* enum flags, raw enum */
     constexpr test_flags src = FLAG1;
     constexpr test_flags f1 = true ? src : FLAG2;
-    gdb_static_assert (f1 == FLAG1);
+    static_assert (f1 == FLAG1);
     constexpr test_flags f2 = false ? src : FLAG2;
-    gdb_static_assert (f2 == FLAG2);
+    static_assert (f2 == FLAG2);
   }
 
   {
@@ -581,9 +581,9 @@ self_test ()
     constexpr test_flags src1 = FLAG1;
     constexpr test_flags src2 = FLAG2;
     constexpr test_flags f1 = true ? src1 : src2;
-    gdb_static_assert (f1 == src1);
+    static_assert (f1 == src1);
     constexpr test_flags f2 = false ? src1 : src2;
-    gdb_static_assert (f2 == src2);
+    static_assert (f2 == src2);
   }
 
   /* Check that we can use flags in switch expressions (requires
index c5dd843b4358d3ddaacac5fe8f1fcc6d4ee86f32..797a453513a6e4c33cb95cd6838ee85a3786fe96 100644 (file)
@@ -32,15 +32,15 @@ enum test_enum
   TE_D = 4,
 };
 
-gdb_static_assert (sizeof (packed<test_enum, 1>) == 1);
-gdb_static_assert (sizeof (packed<test_enum, 2>) == 2);
-gdb_static_assert (sizeof (packed<test_enum, 3>) == 3);
-gdb_static_assert (sizeof (packed<test_enum, 4>) == 4);
-
-gdb_static_assert (alignof (packed<test_enum, 1>) == 1);
-gdb_static_assert (alignof (packed<test_enum, 2>) == 1);
-gdb_static_assert (alignof (packed<test_enum, 3>) == 1);
-gdb_static_assert (alignof (packed<test_enum, 4>) == 1);
+static_assert (sizeof (packed<test_enum, 1>) == 1);
+static_assert (sizeof (packed<test_enum, 2>) == 2);
+static_assert (sizeof (packed<test_enum, 3>) == 3);
+static_assert (sizeof (packed<test_enum, 4>) == 4);
+
+static_assert (alignof (packed<test_enum, 1>) == 1);
+static_assert (alignof (packed<test_enum, 2>) == 1);
+static_assert (alignof (packed<test_enum, 3>) == 1);
+static_assert (alignof (packed<test_enum, 4>) == 1);
 
 /* Triviality checks.  */
 #define CHECK_TRAIT(TRAIT)                     \
index 240536805d7f3472e5d4023de33d1d7270c9a452..f93d57d3e52505d937e99b5259eef133105dee25 100644 (file)
@@ -312,7 +312,7 @@ v850_register_name (struct gdbarch *gdbarch, int regnum)
     "sr24", "sr25", "sr26", "sr27", "sr28", "sr29", "sr30", "sr31",
     "pc", "fp"
   };
-  gdb_static_assert (E_NUM_OF_V850_REGS == ARRAY_SIZE (v850_reg_names));
+  static_assert (E_NUM_OF_V850_REGS == ARRAY_SIZE (v850_reg_names));
   return v850_reg_names[regnum];
 }
 
@@ -331,7 +331,7 @@ v850e_register_name (struct gdbarch *gdbarch, int regnum)
     "sr24", "sr25", "sr26", "sr27", "sr28", "sr29", "sr30", "sr31",
     "pc", "fp"
   };
-  gdb_static_assert (E_NUM_OF_V850E_REGS == ARRAY_SIZE (v850e_reg_names));
+  static_assert (E_NUM_OF_V850E_REGS == ARRAY_SIZE (v850e_reg_names));
   return v850e_reg_names[regnum];
 }
 
@@ -477,7 +477,7 @@ v850e3v5_register_name (struct gdbarch *gdbarch, int regnum)
     "vr24", "vr25", "vr26", "vr27", "vr28", "vr29", "vr30", "vr31",
   };
 
-  gdb_static_assert (E_NUM_OF_V850E3V5_REGS
+  static_assert (E_NUM_OF_V850E3V5_REGS
                     == ARRAY_SIZE (v850e3v5_reg_names));
   return v850e3v5_reg_names[regnum];
 }
index b4da9675039ea641815266b6d7c99ed36949df2b..1a3985582ba569ef75ee6f3d1924b9dbae9ec974 100644 (file)
@@ -762,7 +762,7 @@ static int max_value_size = 65536; /* 64k bytes */
    is bigger than LONGEST on all GDB supported hosts we're fine.  */
 
 #define MIN_VALUE_FOR_MAX_VALUE_SIZE 16
-gdb_static_assert (sizeof (LONGEST) <= MIN_VALUE_FOR_MAX_VALUE_SIZE);
+static_assert (sizeof (LONGEST) <= MIN_VALUE_FOR_MAX_VALUE_SIZE);
 
 /* Implement the "set max-value-size" command.  */
 
index 0f92a469d6c694d7ee200a0f9199f2dcc64d09ea..54f7dd14fb2ba11f573065ea3515bddf1b0307f9 100644 (file)
@@ -45,7 +45,7 @@ vax_register_name (struct gdbarch *gdbarch, int regnum)
     "ps",
   };
 
-  gdb_static_assert (VAX_NUM_REGS == ARRAY_SIZE (register_names));
+  static_assert (VAX_NUM_REGS == ARRAY_SIZE (register_names));
   return register_names[regnum];
 }
 
index c65cdb888f6e00cef4e89b5d5ab283d6dc32e00a..ee25896469f315b04371c81fe4149515abd7131c 100644 (file)
@@ -975,7 +975,7 @@ struct pe_import_directory_entry
   uint32_t import_address_table_rva;
 };
 
-gdb_static_assert (sizeof (pe_import_directory_entry) == 20);
+static_assert (sizeof (pe_import_directory_entry) == 20);
 
 /* See windows-tdep.h.  */
 
index 3f47c8d68a06a2b9c9776a0b8e6be1d80435eecb..27be5afcd59824dd0c85a592f88e50c3fb01ac58 100644 (file)
@@ -108,7 +108,7 @@ xstormy16_register_name (struct gdbarch *gdbarch, int regnum)
     "psw", "sp", "pc"
   };
 
-  gdb_static_assert (ARRAY_SIZE (register_names) == E_NUM_REGS);
+  static_assert (ARRAY_SIZE (register_names) == E_NUM_REGS);
   return register_names[regnum];
 }
 
index 27f8e2dbb73fc6d5e116b53864b2080548bcb31a..f3457a87c7f8251c0de2c040b96b1610cc7a21de 100644 (file)
@@ -83,7 +83,7 @@ struct i387_fxsave
   unsigned char xmm_space[256];
 };
 
-gdb_static_assert (sizeof(i387_fxsave) == 416);
+static_assert (sizeof(i387_fxsave) == 416);
 
 struct i387_xsave : public i387_fxsave
 {
@@ -147,7 +147,7 @@ public:
   { return xsave () + xsave_layout.pkru_offset; }
 };
 
-gdb_static_assert (sizeof(i387_xsave) == 576);
+static_assert (sizeof(i387_xsave) == 576);
 
 void
 i387_cache_to_fsave (struct regcache *regcache, void *buf)
index f91f70d2aa9717644e7f5321ecbecdc398e01c44..d73d637e0fe2136152088472b1cc732c0e0f5bee 100644 (file)
@@ -55,7 +55,7 @@
 /* PBUFSIZ must also be at least as big as IPA_CMD_BUF_SIZE, because
    the client state data is passed directly to some agent
    functions.  */
-gdb_static_assert (PBUFSIZ >= IPA_CMD_BUF_SIZE);
+static_assert (PBUFSIZ >= IPA_CMD_BUF_SIZE);
 
 #define require_running_or_return(BUF)         \
   if (!target_running ())                      \
index 306d75d4e9b23042df1e624d8759bc48f3d0af25..2bca471894125ba55b6d28746148071f47c340aa 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <config.h>
 
-gdb_static_assert (sizeof (CORE_ADDR) >= sizeof (void *));
+static_assert (sizeof (CORE_ADDR) >= sizeof (void *));
 
 #include "gdbsupport/version.h"
 
index f399036e4606ea363a2812cd0eaf4254eca11a21..e5da39e19aac448e6c4a8c04a679488557386891 100644 (file)
 
 #include "errors.h"
 
-/* A static assertion.  This will cause a compile-time error if EXPR,
-   which must be a compile-time constant, is false.  */
-
-#define gdb_static_assert(expr) static_assert (expr, "")
-
 /* PRAGMATICS: "gdb_assert.h":gdb_assert() is a lower case (rather
    than upper case) macro since that provides the closest fit to the
    existing lower case macro <assert.h>:assert() that it is
index c9fcc5033cb69e5c5e6be800e270962dbc461b8b..9407b59646982c929b249a0277fa198a46f4435f 100644 (file)
@@ -62,7 +62,7 @@ public:
 
   packed (T val)
   {
-    gdb_static_assert (sizeof (ULONGEST) >= sizeof (T));
+    static_assert (sizeof (ULONGEST) >= sizeof (T));
 
 #if PACKED_USE_ARRAY
     ULONGEST tmp = val;
@@ -76,17 +76,17 @@ public:
 #endif
 
     /* Ensure size and aligment are what we expect.  */
-    gdb_static_assert (sizeof (packed) == Bytes);
-    gdb_static_assert (alignof (packed) == 1);
+    static_assert (sizeof (packed) == Bytes);
+    static_assert (alignof (packed) == 1);
 
     /* Make sure packed can be wrapped with std::atomic.  */
 #if HAVE_IS_TRIVIALLY_COPYABLE
-    gdb_static_assert (std::is_trivially_copyable<packed>::value);
+    static_assert (std::is_trivially_copyable<packed>::value);
 #endif
-    gdb_static_assert (std::is_copy_constructible<packed>::value);
-    gdb_static_assert (std::is_move_constructible<packed>::value);
-    gdb_static_assert (std::is_copy_assignable<packed>::value);
-    gdb_static_assert (std::is_move_assignable<packed>::value);
+    static_assert (std::is_copy_constructible<packed>::value);
+    static_assert (std::is_move_constructible<packed>::value);
+    static_assert (std::is_copy_assignable<packed>::value);
+    static_assert (std::is_move_assignable<packed>::value);
   }
 
   operator T () const noexcept
index b22a521e68d04ea7a80960ed3b35e91029d5710b..4a0a19ea2985f47245a06fbb4e6032b9488203bd 100644 (file)
@@ -76,7 +76,7 @@ std::string
 path_join (Args... paths)
 {
   /* It doesn't make sense to join less than two paths.  */
-  gdb_static_assert (sizeof... (Args) >= 2);
+  static_assert (sizeof... (Args) >= 2);
 
   std::array<const char *, sizeof... (Args)> path_array
     { paths... };