+2022-09-10 Bruno Haible <bruno@clisp.org>
+
+ Reorganize C++ tests for stdbool and stdbool-c99.
+ * tests/test-stdbool-c++.cc: Don't include <stdbool.h> if TEST_STDBOOL_H
+ is not defined. Add a couple of simple tests, from test-stdbool.c.
+ * tests/test-stdbool-c99-c++.cc: New file.
+ * modules/stdbool-c99-c++-tests: New file, based on
+ modules/stdbool-c++-tests.
+ * modules/stdbool-c99-tests (Depends-on): Add stdbool-c99-c++-tests.
+ Remove stdbool-c++-tests.
+ * modules/stdbool-tests (Depends-on): Add stdbool-c++-tests.
+
2022-09-10 Bruno Haible <bruno@clisp.org>
stdbool C++ tests: Fix for C++20.
--- /dev/null
+Files:
+tests/test-stdbool-c99-c++.cc
+tests/test-stdbool-c++.cc
+tests/test-stdbool-c++2.cc
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-stdbool-c99-c++
+check_PROGRAMS += test-stdbool-c99-c++
+test_stdbool_c99_c___SOURCES = test-stdbool-c99-c++.cc test-stdbool-c++2.cc
+endif
#define GNULIB_NAMESPACE gnulib
#include <config.h>
-#include <stdbool.h>
+#ifdef TEST_STDBOOL_H
+# include <stdbool.h>
+#endif
+
+
+/* These tests are a subset of the C language tests in test-stdbool.c. */
+
+#if false
+ "error: false is not 0"
+#endif
+#if true != 1
+ "error: true is not 1"
+#endif
+
+struct s { bool s: 1; bool t; } s;
+
+char a[true == 1 ? 1 : -1];
+char b[false == 0 ? 1 : -1];
+char c[(unsigned char) true == 1 ? 1 : -1];
+char d[(unsigned char) false == 0 ? 1 : -1];
int