]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libcc1: use static_assert
authorTom Tromey <tom@tromey.com>
Tue, 4 May 2021 21:26:58 +0000 (15:26 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 5 May 2021 06:06:17 +0000 (00:06 -0600)
This changes one spot in libcc1 to use static_assert rather than the
old-style array declaration.

libcc1

* libcp1plugin.cc: Use static assert.

libcc1/libcp1plugin.cc

index 3cbad5c6f021dfe91d7790b7b8ae7791fc1e2668..ba6c5ef2efce07203d6a991b2dc216eece151a6f 100644 (file)
@@ -82,8 +82,8 @@ int plugin_is_GPL_compatible;
 
 \f
 
-static int ATTRIBUTE_UNUSED
-check_symbol_mask[GCC_CP_SYMBOL_MASK >= GCC_CP_SYMBOL_END ? 1 : -1];
+static_assert (GCC_CP_SYMBOL_MASK >= GCC_CP_SYMBOL_END,
+              "GCC_CP_SYMBOL_MASK >= GCC_CP_SYMBOL_END");
 
 // This is put into the lang hooks when the plugin starts.