Christian Biesinger wrote:
> Testcase:
> #include "gnulib/config.h"
> #include <wchar.h> // optional
> #include <sstream>
> 
> int main() {
> }

Let me add more C++ tests to gnulib, so that such errors become apparent
when compiling a testdir created with the option 'with-c++-tests'.


2019-12-05  Bruno Haible  <br...@clisp.org>

        Add more C++ tests.

        assert-h: Add C++ tests.
        * tests/test-assert-h-c++.cc: New file.
        * tests/test-assert-h-c++2.cc: New file.
        * modules/assert-h-c++-tests: New file.
        * modules/assert-h-tests: New file.

        ctype: Add C++ tests.
        * tests/test-ctype-c++.cc: New file.
        * tests/test-ctype-c++2.cc: New file.
        * modules/ctype-c++-tests: New file.
        * modules/ctype-tests (Depends-on): Add ctype-c++-tests.

        errno: Add C++ tests.
        * tests/test-errno-c++.cc: New file.
        * tests/test-errno-c++2.cc: New file.
        * modules/errno-c++-tests: New file.
        * modules/errno-tests (Depends-on): Add errno-c++-tests.

        float: Add C++ tests.
        * tests/test-float-c++.cc: New file.
        * tests/test-float-c++2.cc: New file.
        * modules/float-c++-tests: New file.
        * modules/float-tests (Depends-on): Add float-c++-tests.

        inttypes: Add more C++ tests.
        * tests/test-inttypes-c++2.cc: New file.
        * modules/inttypes-c++-tests (Files): Add it.
        (Makefile.am): Compile it.

        limits-h: Add C++ tests.
        * tests/test-limits-h-c++.cc: New file.
        * tests/test-limits-h-c++2.cc: New file.
        * modules/limits-h-c++-tests: New file.
        * modules/limits-h-tests (Depends-on): Add limits-h-c++-tests.

        stdarg: Add C++ tests.
        * tests/test-stdarg-c++.cc: New file.
        * tests/test-stdarg-c++2.cc: New file.
        * modules/stdarg-c++-tests: New file.
        * modules/stdarg-tests: New file.

        stdbool: Add C++ tests.
        * tests/test-stdbool-c++.cc: New file.
        * tests/test-stdbool-c++2.cc: New file.
        * modules/stdbool-c++-tests: New file.
        * modules/stdbool-tests (Depends-on): Add stdbool-c++-tests.

        stddef: Add C++ tests.
        * tests/test-stddef-c++.cc: New file.
        * tests/test-stddef-c++2.cc: New file.
        * modules/stddef-c++-tests: New file.
        * modules/stddef-tests (Depends-on): Add stddef-c++-tests.

        stdint: Add C++ tests.
        * tests/test-stdint-c++.cc: New file.
        * tests/test-stdint-c++2.cc: New file.
        * modules/stdint-c++-tests: New file.
        * modules/stdint-tests (Depends-on): Add stdint-c++-tests.

        wchar: Add more C++ tests.
        * tests/test-wchar-c++2.cc: New file.
        * modules/wchar-c++-tests (Files): Add it.
        (Makefile.am): Compile it.

        wctype-h: Add more C++ tests.
        * tests/test-wctype-h-c++2.cc: New file.
        * modules/wctype-h-c++-tests (Files): Add it.
        (Makefile.am): Compile it.

2019-12-05  Bruno Haible  <br...@clisp.org>

        wchar: Add more C++ tests.
        Reported by Christian Biesinger <cbiesin...@google.com> in
        <https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00009.html>.
        * tests/test-wchar-c++3.cc: New file.
        * modules/wchar-c++-tests (Files): Add it.
        (Makefile.am): Compile it.

>From ea45fdf1af3c1dc7ce603b0b7f3d50fd8475077e Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Thu, 5 Dec 2019 09:11:45 +0100
Subject: [PATCH 1/3] Add more C++ tests.

assert-h: Add C++ tests.
* tests/test-assert-h-c++.cc: New file.
* tests/test-assert-h-c++2.cc: New file.
* modules/assert-h-c++-tests: New file.
* modules/assert-h-tests: New file.

ctype: Add C++ tests.
* tests/test-ctype-c++.cc: New file.
* tests/test-ctype-c++2.cc: New file.
* modules/ctype-c++-tests: New file.
* modules/ctype-tests (Depends-on): Add ctype-c++-tests.

errno: Add C++ tests.
* tests/test-errno-c++.cc: New file.
* tests/test-errno-c++2.cc: New file.
* modules/errno-c++-tests: New file.
* modules/errno-tests (Depends-on): Add errno-c++-tests.

float: Add C++ tests.
* tests/test-float-c++.cc: New file.
* tests/test-float-c++2.cc: New file.
* modules/float-c++-tests: New file.
* modules/float-tests (Depends-on): Add float-c++-tests.

inttypes: Add more C++ tests.
* tests/test-inttypes-c++2.cc: New file.
* modules/inttypes-c++-tests (Files): Add it.
(Makefile.am): Compile it.

limits-h: Add C++ tests.
* tests/test-limits-h-c++.cc: New file.
* tests/test-limits-h-c++2.cc: New file.
* modules/limits-h-c++-tests: New file.
* modules/limits-h-tests (Depends-on): Add limits-h-c++-tests.

stdarg: Add C++ tests.
* tests/test-stdarg-c++.cc: New file.
* tests/test-stdarg-c++2.cc: New file.
* modules/stdarg-c++-tests: New file.
* modules/stdarg-tests: New file.

stdbool: Add C++ tests.
* tests/test-stdbool-c++.cc: New file.
* tests/test-stdbool-c++2.cc: New file.
* modules/stdbool-c++-tests: New file.
* modules/stdbool-tests (Depends-on): Add stdbool-c++-tests.

stddef: Add C++ tests.
* tests/test-stddef-c++.cc: New file.
* tests/test-stddef-c++2.cc: New file.
* modules/stddef-c++-tests: New file.
* modules/stddef-tests (Depends-on): Add stddef-c++-tests.

stdint: Add C++ tests.
* tests/test-stdint-c++.cc: New file.
* tests/test-stdint-c++2.cc: New file.
* modules/stdint-c++-tests: New file.
* modules/stdint-tests (Depends-on): Add stdint-c++-tests.

wchar: Add more C++ tests.
* tests/test-wchar-c++2.cc: New file.
* modules/wchar-c++-tests (Files): Add it.
(Makefile.am): Compile it.

wctype-h: Add more C++ tests.
* tests/test-wctype-h-c++2.cc: New file.
* modules/wctype-h-c++-tests (Files): Add it.
(Makefile.am): Compile it.
---
 ChangeLog                   | 73 +++++++++++++++++++++++++++++++++++++++++++++
 modules/assert-h-c++-tests  | 18 +++++++++++
 modules/assert-h-tests      |  7 +++++
 modules/ctype-c++-tests     | 19 ++++++++++++
 modules/ctype-tests         |  1 +
 modules/errno-c++-tests     | 18 +++++++++++
 modules/errno-tests         |  1 +
 modules/float-c++-tests     | 18 +++++++++++
 modules/float-tests         |  1 +
 modules/inttypes-c++-tests  |  3 +-
 modules/limits-h-c++-tests  | 18 +++++++++++
 modules/limits-h-tests      |  1 +
 modules/stdarg-c++-tests    | 18 +++++++++++
 modules/stdarg-tests        |  7 +++++
 modules/stdbool-c++-tests   | 18 +++++++++++
 modules/stdbool-tests       |  1 +
 modules/stddef-c++-tests    | 18 +++++++++++
 modules/stddef-tests        |  1 +
 modules/stdint-c++-tests    | 18 +++++++++++
 modules/stdint-tests        |  1 +
 modules/wchar-c++-tests     |  3 +-
 modules/wctype-h-c++-tests  |  3 +-
 tests/test-assert-h-c++.cc  | 28 +++++++++++++++++
 tests/test-assert-h-c++2.cc | 20 +++++++++++++
 tests/test-ctype-c++.cc     | 35 ++++++++++++++++++++++
 tests/test-ctype-c++2.cc    | 20 +++++++++++++
 tests/test-errno-c++.cc     | 28 +++++++++++++++++
 tests/test-errno-c++2.cc    | 20 +++++++++++++
 tests/test-float-c++.cc     | 28 +++++++++++++++++
 tests/test-float-c++2.cc    | 20 +++++++++++++
 tests/test-inttypes-c++2.cc | 24 +++++++++++++++
 tests/test-limits-h-c++.cc  | 28 +++++++++++++++++
 tests/test-limits-h-c++2.cc | 20 +++++++++++++
 tests/test-stdarg-c++.cc    | 28 +++++++++++++++++
 tests/test-stdarg-c++2.cc   | 20 +++++++++++++
 tests/test-stdbool-c++.cc   | 28 +++++++++++++++++
 tests/test-stdbool-c++2.cc  | 24 +++++++++++++++
 tests/test-stddef-c++.cc    | 28 +++++++++++++++++
 tests/test-stddef-c++2.cc   | 20 +++++++++++++
 tests/test-stdint-c++.cc    | 28 +++++++++++++++++
 tests/test-stdint-c++2.cc   | 24 +++++++++++++++
 tests/test-wchar-c++2.cc    | 20 +++++++++++++
 tests/test-wctype-h-c++2.cc | 20 +++++++++++++
 43 files changed, 774 insertions(+), 3 deletions(-)
 create mode 100644 modules/assert-h-c++-tests
 create mode 100644 modules/assert-h-tests
 create mode 100644 modules/ctype-c++-tests
 create mode 100644 modules/errno-c++-tests
 create mode 100644 modules/float-c++-tests
 create mode 100644 modules/limits-h-c++-tests
 create mode 100644 modules/stdarg-c++-tests
 create mode 100644 modules/stdarg-tests
 create mode 100644 modules/stdbool-c++-tests
 create mode 100644 modules/stddef-c++-tests
 create mode 100644 modules/stdint-c++-tests
 create mode 100644 tests/test-assert-h-c++.cc
 create mode 100644 tests/test-assert-h-c++2.cc
 create mode 100644 tests/test-ctype-c++.cc
 create mode 100644 tests/test-ctype-c++2.cc
 create mode 100644 tests/test-errno-c++.cc
 create mode 100644 tests/test-errno-c++2.cc
 create mode 100644 tests/test-float-c++.cc
 create mode 100644 tests/test-float-c++2.cc
 create mode 100644 tests/test-inttypes-c++2.cc
 create mode 100644 tests/test-limits-h-c++.cc
 create mode 100644 tests/test-limits-h-c++2.cc
 create mode 100644 tests/test-stdarg-c++.cc
 create mode 100644 tests/test-stdarg-c++2.cc
 create mode 100644 tests/test-stdbool-c++.cc
 create mode 100644 tests/test-stdbool-c++2.cc
 create mode 100644 tests/test-stddef-c++.cc
 create mode 100644 tests/test-stddef-c++2.cc
 create mode 100644 tests/test-stdint-c++.cc
 create mode 100644 tests/test-stdint-c++2.cc
 create mode 100644 tests/test-wchar-c++2.cc
 create mode 100644 tests/test-wctype-h-c++2.cc

diff --git a/ChangeLog b/ChangeLog
index cb3ffc7..bbc40dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,76 @@
+2019-12-05  Bruno Haible  <br...@clisp.org>
+
+	Add more C++ tests.
+
+	assert-h: Add C++ tests.
+	* tests/test-assert-h-c++.cc: New file.
+	* tests/test-assert-h-c++2.cc: New file.
+	* modules/assert-h-c++-tests: New file.
+	* modules/assert-h-tests: New file.
+
+	ctype: Add C++ tests.
+	* tests/test-ctype-c++.cc: New file.
+	* tests/test-ctype-c++2.cc: New file.
+	* modules/ctype-c++-tests: New file.
+	* modules/ctype-tests (Depends-on): Add ctype-c++-tests.
+
+	errno: Add C++ tests.
+	* tests/test-errno-c++.cc: New file.
+	* tests/test-errno-c++2.cc: New file.
+	* modules/errno-c++-tests: New file.
+	* modules/errno-tests (Depends-on): Add errno-c++-tests.
+
+	float: Add C++ tests.
+	* tests/test-float-c++.cc: New file.
+	* tests/test-float-c++2.cc: New file.
+	* modules/float-c++-tests: New file.
+	* modules/float-tests (Depends-on): Add float-c++-tests.
+
+	inttypes: Add more C++ tests.
+	* tests/test-inttypes-c++2.cc: New file.
+	* modules/inttypes-c++-tests (Files): Add it.
+	(Makefile.am): Compile it.
+
+	limits-h: Add C++ tests.
+	* tests/test-limits-h-c++.cc: New file.
+	* tests/test-limits-h-c++2.cc: New file.
+	* modules/limits-h-c++-tests: New file.
+	* modules/limits-h-tests (Depends-on): Add limits-h-c++-tests.
+
+	stdarg: Add C++ tests.
+	* tests/test-stdarg-c++.cc: New file.
+	* tests/test-stdarg-c++2.cc: New file.
+	* modules/stdarg-c++-tests: New file.
+	* modules/stdarg-tests: New file.
+
+	stdbool: Add C++ tests.
+	* tests/test-stdbool-c++.cc: New file.
+	* tests/test-stdbool-c++2.cc: New file.
+	* modules/stdbool-c++-tests: New file.
+	* modules/stdbool-tests (Depends-on): Add stdbool-c++-tests.
+
+	stddef: Add C++ tests.
+	* tests/test-stddef-c++.cc: New file.
+	* tests/test-stddef-c++2.cc: New file.
+	* modules/stddef-c++-tests: New file.
+	* modules/stddef-tests (Depends-on): Add stddef-c++-tests.
+
+	stdint: Add C++ tests.
+	* tests/test-stdint-c++.cc: New file.
+	* tests/test-stdint-c++2.cc: New file.
+	* modules/stdint-c++-tests: New file.
+	* modules/stdint-tests (Depends-on): Add stdint-c++-tests.
+
+	wchar: Add more C++ tests.
+	* tests/test-wchar-c++2.cc: New file.
+	* modules/wchar-c++-tests (Files): Add it.
+	(Makefile.am): Compile it.
+
+	wctype-h: Add more C++ tests.
+	* tests/test-wctype-h-c++2.cc: New file.
+	* modules/wctype-h-c++-tests (Files): Add it.
+	(Makefile.am): Compile it.
+
 2019-12-04  Bruno Haible  <br...@clisp.org>
 
 	Fix compilation errors in C++ mode with xlclang++ on AIX.
diff --git a/modules/assert-h-c++-tests b/modules/assert-h-c++-tests
new file mode 100644
index 0000000..23691d0
--- /dev/null
+++ b/modules/assert-h-c++-tests
@@ -0,0 +1,18 @@
+Files:
+tests/test-assert-h-c++.cc
+tests/test-assert-h-c++2.cc
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-assert-h-c++
+check_PROGRAMS += test-assert-h-c++
+test_assert_h_c___SOURCES = test-assert-h-c++.cc test-assert-h-c++2.cc
+endif
diff --git a/modules/assert-h-tests b/modules/assert-h-tests
new file mode 100644
index 0000000..19375f6
--- /dev/null
+++ b/modules/assert-h-tests
@@ -0,0 +1,7 @@
+Files:
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
diff --git a/modules/ctype-c++-tests b/modules/ctype-c++-tests
new file mode 100644
index 0000000..9ba7659
--- /dev/null
+++ b/modules/ctype-c++-tests
@@ -0,0 +1,19 @@
+Files:
+tests/test-ctype-c++.cc
+tests/test-ctype-c++2.cc
+tests/signature.h
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-ctype-c++
+check_PROGRAMS += test-ctype-c++
+test_ctype_c___SOURCES = test-ctype-c++.cc test-ctype-c++2.cc
+endif
diff --git a/modules/ctype-tests b/modules/ctype-tests
index 4b9f4af..cae5067 100644
--- a/modules/ctype-tests
+++ b/modules/ctype-tests
@@ -2,6 +2,7 @@ Files:
 tests/test-ctype.c
 
 Depends-on:
+ctype-c++-tests
 
 configure.ac:
 
diff --git a/modules/errno-c++-tests b/modules/errno-c++-tests
new file mode 100644
index 0000000..f4083bd
--- /dev/null
+++ b/modules/errno-c++-tests
@@ -0,0 +1,18 @@
+Files:
+tests/test-errno-c++.cc
+tests/test-errno-c++2.cc
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-errno-c++
+check_PROGRAMS += test-errno-c++
+test_errno_c___SOURCES = test-errno-c++.cc test-errno-c++2.cc
+endif
diff --git a/modules/errno-tests b/modules/errno-tests
index 00ec12b..71e732c 100644
--- a/modules/errno-tests
+++ b/modules/errno-tests
@@ -2,6 +2,7 @@ Files:
 tests/test-errno.c
 
 Depends-on:
+errno-c++-tests
 
 configure.ac:
 
diff --git a/modules/float-c++-tests b/modules/float-c++-tests
new file mode 100644
index 0000000..7fdc7f5
--- /dev/null
+++ b/modules/float-c++-tests
@@ -0,0 +1,18 @@
+Files:
+tests/test-float-c++.cc
+tests/test-float-c++2.cc
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-float-c++
+check_PROGRAMS += test-float-c++
+test_float_c___SOURCES = test-float-c++.cc test-float-c++2.cc
+endif
diff --git a/modules/float-tests b/modules/float-tests
index 7d61f8e..a68e021 100644
--- a/modules/float-tests
+++ b/modules/float-tests
@@ -5,6 +5,7 @@ tests/macros.h
 Depends-on:
 fpieee
 fpucw
+float-c++-tests
 
 configure.ac:
 
diff --git a/modules/inttypes-c++-tests b/modules/inttypes-c++-tests
index 7f7e918..b28189f 100644
--- a/modules/inttypes-c++-tests
+++ b/modules/inttypes-c++-tests
@@ -1,5 +1,6 @@
 Files:
 tests/test-inttypes-c++.cc
+tests/test-inttypes-c++2.cc
 tests/signature.h
 
 Status:
@@ -14,5 +15,5 @@ Makefile.am:
 if ANSICXX
 TESTS += test-inttypes-c++
 check_PROGRAMS += test-inttypes-c++
-test_inttypes_c___SOURCES = test-inttypes-c++.cc
+test_inttypes_c___SOURCES = test-inttypes-c++.cc test-inttypes-c++2.cc
 endif
diff --git a/modules/limits-h-c++-tests b/modules/limits-h-c++-tests
new file mode 100644
index 0000000..e976341
--- /dev/null
+++ b/modules/limits-h-c++-tests
@@ -0,0 +1,18 @@
+Files:
+tests/test-limits-h-c++.cc
+tests/test-limits-h-c++2.cc
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-limits-h-c++
+check_PROGRAMS += test-limits-h-c++
+test_limits_h_c___SOURCES = test-limits-h-c++.cc test-limits-h-c++2.cc
+endif
diff --git a/modules/limits-h-tests b/modules/limits-h-tests
index cda0de2..7a70e57 100644
--- a/modules/limits-h-tests
+++ b/modules/limits-h-tests
@@ -4,6 +4,7 @@ tests/test-limits-h.c
 Depends-on:
 extensions
 verify
+limits-h-c++-tests
 
 configure.ac:
 
diff --git a/modules/stdarg-c++-tests b/modules/stdarg-c++-tests
new file mode 100644
index 0000000..6177388
--- /dev/null
+++ b/modules/stdarg-c++-tests
@@ -0,0 +1,18 @@
+Files:
+tests/test-stdarg-c++.cc
+tests/test-stdarg-c++2.cc
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-stdarg-c++
+check_PROGRAMS += test-stdarg-c++
+test_stdarg_c___SOURCES = test-stdarg-c++.cc test-stdarg-c++2.cc
+endif
diff --git a/modules/stdarg-tests b/modules/stdarg-tests
new file mode 100644
index 0000000..19375f6
--- /dev/null
+++ b/modules/stdarg-tests
@@ -0,0 +1,7 @@
+Files:
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
diff --git a/modules/stdbool-c++-tests b/modules/stdbool-c++-tests
new file mode 100644
index 0000000..4d44e8e
--- /dev/null
+++ b/modules/stdbool-c++-tests
@@ -0,0 +1,18 @@
+Files:
+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-c++
+check_PROGRAMS += test-stdbool-c++
+test_stdbool_c___SOURCES = test-stdbool-c++.cc test-stdbool-c++2.cc
+endif
diff --git a/modules/stdbool-tests b/modules/stdbool-tests
index 6905dfb..0f875fb 100644
--- a/modules/stdbool-tests
+++ b/modules/stdbool-tests
@@ -2,6 +2,7 @@ Files:
 tests/test-stdbool.c
 
 Depends-on:
+stdbool-c++-tests
 
 configure.ac:
 
diff --git a/modules/stddef-c++-tests b/modules/stddef-c++-tests
new file mode 100644
index 0000000..c11a16f
--- /dev/null
+++ b/modules/stddef-c++-tests
@@ -0,0 +1,18 @@
+Files:
+tests/test-stddef-c++.cc
+tests/test-stddef-c++2.cc
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-stddef-c++
+check_PROGRAMS += test-stddef-c++
+test_stddef_c___SOURCES = test-stddef-c++.cc test-stddef-c++2.cc
+endif
diff --git a/modules/stddef-tests b/modules/stddef-tests
index cef92fa..bb71e11 100644
--- a/modules/stddef-tests
+++ b/modules/stddef-tests
@@ -4,6 +4,7 @@ tests/test-stddef.c
 Depends-on:
 stdalign
 verify
+stddef-c++-tests
 
 configure.ac:
 
diff --git a/modules/stdint-c++-tests b/modules/stdint-c++-tests
new file mode 100644
index 0000000..c5ea031
--- /dev/null
+++ b/modules/stdint-c++-tests
@@ -0,0 +1,18 @@
+Files:
+tests/test-stdint-c++.cc
+tests/test-stdint-c++2.cc
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-stdint-c++
+check_PROGRAMS += test-stdint-c++
+test_stdint_c___SOURCES = test-stdint-c++.cc test-stdint-c++2.cc
+endif
diff --git a/modules/stdint-tests b/modules/stdint-tests
index c21bfa1..44d9cde 100644
--- a/modules/stdint-tests
+++ b/modules/stdint-tests
@@ -8,6 +8,7 @@ extensions
 verify
 intprops
 wchar
+stdint-c++-tests
 
 configure.ac:
 AC_REQUIRE([gt_TYPE_WCHAR_T])
diff --git a/modules/wchar-c++-tests b/modules/wchar-c++-tests
index cd898e2..75ff651 100644
--- a/modules/wchar-c++-tests
+++ b/modules/wchar-c++-tests
@@ -1,5 +1,6 @@
 Files:
 tests/test-wchar-c++.cc
+tests/test-wchar-c++2.cc
 tests/signature.h
 
 Status:
@@ -14,6 +15,6 @@ Makefile.am:
 if ANSICXX
 TESTS += test-wchar-c++
 check_PROGRAMS += test-wchar-c++
-test_wchar_c___SOURCES = test-wchar-c++.cc
+test_wchar_c___SOURCES = test-wchar-c++.cc test-wchar-c++2.cc
 test_wchar_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS) $(LIBTHREAD)
 endif
diff --git a/modules/wctype-h-c++-tests b/modules/wctype-h-c++-tests
index 2b22df4..0f7db9c 100644
--- a/modules/wctype-h-c++-tests
+++ b/modules/wctype-h-c++-tests
@@ -1,5 +1,6 @@
 Files:
 tests/test-wctype-h-c++.cc
+tests/test-wctype-h-c++2.cc
 tests/signature.h
 
 Status:
@@ -14,6 +15,6 @@ Makefile.am:
 if ANSICXX
 TESTS += test-wctype-h-c++
 check_PROGRAMS += test-wctype-h-c++
-test_wctype_h_c___SOURCES = test-wctype-h-c++.cc
+test_wctype_h_c___SOURCES = test-wctype-h-c++.cc test-wctype-h-c++2.cc
 test_wctype_h_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS)
 endif
diff --git a/tests/test-assert-h-c++.cc b/tests/test-assert-h-c++.cc
new file mode 100644
index 0000000..4e0a0d4
--- /dev/null
+++ b/tests/test-assert-h-c++.cc
@@ -0,0 +1,28 @@
+/* Test of <assert.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <br...@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <assert.h>
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-assert-h-c++2.cc b/tests/test-assert-h-c++2.cc
new file mode 100644
index 0000000..8308933
--- /dev/null
+++ b/tests/test-assert-h-c++2.cc
@@ -0,0 +1,20 @@
+/* Test of <assert.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <cassert>
diff --git a/tests/test-ctype-c++.cc b/tests/test-ctype-c++.cc
new file mode 100644
index 0000000..5d94c4c
--- /dev/null
+++ b/tests/test-ctype-c++.cc
@@ -0,0 +1,35 @@
+/* Test of <ctype.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <br...@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <ctype.h>
+
+#include "signature.h"
+
+
+#if 0
+SIGNATURE_CHECK (GNULIB_NAMESPACE::isblank, int, (int));
+#endif
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-ctype-c++2.cc b/tests/test-ctype-c++2.cc
new file mode 100644
index 0000000..509261a
--- /dev/null
+++ b/tests/test-ctype-c++2.cc
@@ -0,0 +1,20 @@
+/* Test of <ctype.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <cctype>
diff --git a/tests/test-errno-c++.cc b/tests/test-errno-c++.cc
new file mode 100644
index 0000000..0a979f6
--- /dev/null
+++ b/tests/test-errno-c++.cc
@@ -0,0 +1,28 @@
+/* Test of <errno.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <br...@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <errno.h>
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-errno-c++2.cc b/tests/test-errno-c++2.cc
new file mode 100644
index 0000000..d67de70
--- /dev/null
+++ b/tests/test-errno-c++2.cc
@@ -0,0 +1,20 @@
+/* Test of <errno.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <cerrno>
diff --git a/tests/test-float-c++.cc b/tests/test-float-c++.cc
new file mode 100644
index 0000000..d199f12
--- /dev/null
+++ b/tests/test-float-c++.cc
@@ -0,0 +1,28 @@
+/* Test of <float.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <br...@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <float.h>
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-float-c++2.cc b/tests/test-float-c++2.cc
new file mode 100644
index 0000000..489dfb1
--- /dev/null
+++ b/tests/test-float-c++2.cc
@@ -0,0 +1,20 @@
+/* Test of <float.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <cfloat>
diff --git a/tests/test-inttypes-c++2.cc b/tests/test-inttypes-c++2.cc
new file mode 100644
index 0000000..a05e1d0
--- /dev/null
+++ b/tests/test-inttypes-c++2.cc
@@ -0,0 +1,24 @@
+/* Test of <inttypes.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#if __cplusplus >= 201103
+
+# include <cinttypes>
+
+#endif
diff --git a/tests/test-limits-h-c++.cc b/tests/test-limits-h-c++.cc
new file mode 100644
index 0000000..e550a33
--- /dev/null
+++ b/tests/test-limits-h-c++.cc
@@ -0,0 +1,28 @@
+/* Test of <limits.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <br...@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <limits.h>
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-limits-h-c++2.cc b/tests/test-limits-h-c++2.cc
new file mode 100644
index 0000000..7363af6
--- /dev/null
+++ b/tests/test-limits-h-c++2.cc
@@ -0,0 +1,20 @@
+/* Test of <limits.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <climits>
diff --git a/tests/test-stdarg-c++.cc b/tests/test-stdarg-c++.cc
new file mode 100644
index 0000000..5f4d2e8
--- /dev/null
+++ b/tests/test-stdarg-c++.cc
@@ -0,0 +1,28 @@
+/* Test of <stdarg.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <br...@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <stdarg.h>
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-stdarg-c++2.cc b/tests/test-stdarg-c++2.cc
new file mode 100644
index 0000000..e4661a1
--- /dev/null
+++ b/tests/test-stdarg-c++2.cc
@@ -0,0 +1,20 @@
+/* Test of <stdarg.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <cstdarg>
diff --git a/tests/test-stdbool-c++.cc b/tests/test-stdbool-c++.cc
new file mode 100644
index 0000000..527d44e
--- /dev/null
+++ b/tests/test-stdbool-c++.cc
@@ -0,0 +1,28 @@
+/* Test of <stdbool.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <br...@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <stdbool.h>
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-stdbool-c++2.cc b/tests/test-stdbool-c++2.cc
new file mode 100644
index 0000000..9db9c2f
--- /dev/null
+++ b/tests/test-stdbool-c++2.cc
@@ -0,0 +1,24 @@
+/* Test of <stdbool.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#if __cplusplus >= 201103
+
+# include <cstdbool>
+
+#endif
diff --git a/tests/test-stddef-c++.cc b/tests/test-stddef-c++.cc
new file mode 100644
index 0000000..5efc1c2
--- /dev/null
+++ b/tests/test-stddef-c++.cc
@@ -0,0 +1,28 @@
+/* Test of <stddef.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <br...@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <stddef.h>
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-stddef-c++2.cc b/tests/test-stddef-c++2.cc
new file mode 100644
index 0000000..81fed7e
--- /dev/null
+++ b/tests/test-stddef-c++2.cc
@@ -0,0 +1,20 @@
+/* Test of <stddef.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <cstddef>
diff --git a/tests/test-stdint-c++.cc b/tests/test-stdint-c++.cc
new file mode 100644
index 0000000..850d54e
--- /dev/null
+++ b/tests/test-stdint-c++.cc
@@ -0,0 +1,28 @@
+/* Test of <stdint.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <br...@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <stdint.h>
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-stdint-c++2.cc b/tests/test-stdint-c++2.cc
new file mode 100644
index 0000000..149c607
--- /dev/null
+++ b/tests/test-stdint-c++2.cc
@@ -0,0 +1,24 @@
+/* Test of <stdint.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#if __cplusplus >= 201103
+
+# include <cstdint>
+
+#endif
diff --git a/tests/test-wchar-c++2.cc b/tests/test-wchar-c++2.cc
new file mode 100644
index 0000000..3f49ca7
--- /dev/null
+++ b/tests/test-wchar-c++2.cc
@@ -0,0 +1,20 @@
+/* Test of <wchar.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <cwchar>
diff --git a/tests/test-wctype-h-c++2.cc b/tests/test-wctype-h-c++2.cc
new file mode 100644
index 0000000..0f9382e
--- /dev/null
+++ b/tests/test-wctype-h-c++2.cc
@@ -0,0 +1,20 @@
+/* Test of <wctype.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <cwctype>
-- 
2.7.4

>From d81cfbdda4dcadcfe61daeafe92c34871a669098 Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Thu, 5 Dec 2019 09:18:13 +0100
Subject: [PATCH 2/3] wchar: Add more C++ tests.

Reported by Christian Biesinger <cbiesin...@google.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00009.html>.

* tests/test-wchar-c++3.cc: New file.
* modules/wchar-c++-tests (Files): Add it.
(Makefile.am): Compile it.
---
 ChangeLog                |  9 +++++++++
 modules/wchar-c++-tests  |  3 ++-
 tests/test-wchar-c++3.cc | 22 ++++++++++++++++++++++
 3 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 tests/test-wchar-c++3.cc

diff --git a/ChangeLog b/ChangeLog
index bbc40dd..8574070 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2019-12-05  Bruno Haible  <br...@clisp.org>
 
+	wchar: Add more C++ tests.
+	Reported by Christian Biesinger <cbiesin...@google.com> in
+	<https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00009.html>.
+	* tests/test-wchar-c++3.cc: New file.
+	* modules/wchar-c++-tests (Files): Add it.
+	(Makefile.am): Compile it.
+
+2019-12-05  Bruno Haible  <br...@clisp.org>
+
 	Add more C++ tests.
 
 	assert-h: Add C++ tests.
diff --git a/modules/wchar-c++-tests b/modules/wchar-c++-tests
index 75ff651..a91e43a 100644
--- a/modules/wchar-c++-tests
+++ b/modules/wchar-c++-tests
@@ -1,6 +1,7 @@
 Files:
 tests/test-wchar-c++.cc
 tests/test-wchar-c++2.cc
+tests/test-wchar-c++3.cc
 tests/signature.h
 
 Status:
@@ -15,6 +16,6 @@ Makefile.am:
 if ANSICXX
 TESTS += test-wchar-c++
 check_PROGRAMS += test-wchar-c++
-test_wchar_c___SOURCES = test-wchar-c++.cc test-wchar-c++2.cc
+test_wchar_c___SOURCES = test-wchar-c++.cc test-wchar-c++2.cc test-wchar-c++3.cc
 test_wchar_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS) $(LIBTHREAD)
 endif
diff --git a/tests/test-wchar-c++3.cc b/tests/test-wchar-c++3.cc
new file mode 100644
index 0000000..622dec0
--- /dev/null
+++ b/tests/test-wchar-c++3.cc
@@ -0,0 +1,22 @@
+/* Test of <wchar.h> substitute in C++ mode.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <wchar.h>
+#include <cstring>
+#include <sstream>
-- 
2.7.4

Reply via email to