]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix static_assert with one argument
authorMarc Poulhiès <poulhies@adacore.com>
Mon, 28 Oct 2024 15:10:25 +0000 (16:10 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 29 Oct 2024 10:08:22 +0000 (11:08 +0100)
Single argument static_assert is C++17 only and breaks the build using
older GCC (prerequisite is C++14).

gcc/ada

* types.h: fix static_assert.

gcc/ada/types.h

index 3193f01444c046b074aeb70da9a110fad18cec2e..6a7d797905cb30512c84efdec4fc1e51614e1714 100644 (file)
@@ -383,11 +383,9 @@ typedef unsigned int any_slot;
 #define Slot_Size (sizeof (any_slot) * 8)
 
 /* Slots are 32 bits (for now, but we might want to make that 64).
-   The first bootstrap stage uses -std=gnu++98, so we cannot use
-   static_assert in that case.  */
-#if __cplusplus >= 201402L
-static_assert (Slot_Size == 32);
-#endif
+   The first bootstrap stage uses C++14, so we can only use the 2 argument
+   version of static_assert. */
+static_assert (Slot_Size == 32, "");
 
 /* Definitions of Reason codes for Raise_xxx_Error nodes.  */
 enum RT_Exception_Code