[PATCH v2 13/21] libcc1: use static_assert

Tom Tromey tom@tromey.com
Wed Apr 28 01:01:11 GMT 2021


This changes one spot in libcc1 to use static_assert rather than the
old-style array declaration.

libcc1/ChangeLog
2021-04-27  Tom Tromey  <tom@tromey.com>

	* libcp1plugin.cc: Use static assert.
---
 libcc1/ChangeLog       | 4 ++++
 libcc1/libcp1plugin.cc | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
index 3cbad5c6f021..ba6c5ef2efce 100644
--- a/libcc1/libcp1plugin.cc
+++ b/libcc1/libcp1plugin.cc
@@ -82,8 +82,8 @@ int plugin_is_GPL_compatible;
 
 
 
-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.
 
-- 
2.26.2



More information about the Gcc-patches mailing list