* lib/verify.h (static_assert): Define _ALLOW_KEYWORD_MACROS.
* tests/test-assert-h-c++.cc: Strengthen test.
* tests/test-assert-h-c++2.cc: Likewise.
+2023-02-05 Bruno Haible <bruno@clisp.org>
+
+ assert-h, verify: Fix compilation error in C++ mode with MSVC 14.
+ * lib/verify.h (static_assert): Define _ALLOW_KEYWORD_MACROS.
+ * tests/test-assert-h-c++.cc: Strengthen test.
+ * tests/test-assert-h-c++2.cc: Likewise.
+
2023-02-04 Bruno Haible <bruno@clisp.org>
assert-h, verify: Fix conflict with standard C++ header files on macOS.
# define _GL_SA3 static_assert
# define _GL_SA_PICK(x1,x2,x3,x4,...) x4
# define static_assert(...) _GL_EXPAND(_GL_SA_PICK(__VA_ARGS__,_GL_SA3,_GL_SA2,_GL_SA1)) (__VA_ARGS__)
+/* Avoid "fatal error C1189: #error: The C++ Standard Library forbids macroizing keywords." */
+# define _ALLOW_KEYWORD_MACROS 1
# else
# define static_assert _Static_assert /* C11 requires this #define. */
# endif
#include <iostream>
+static_assert (2 + 2 == 4, "arithmetic does not work");
+static_assert (2 + 2 == 4);
+
int
main ()
{
/* Check against conflicts between <cassert> and other C++ header files. */
#include <stddef.h>
#include <iostream>
+
+
+static_assert (2 + 2 == 4, "arithmetic does not work");
+static_assert (2 + 2 == 4);