Branch
Hash :
d19a73d0
Author :
Date :
2025-05-28T01:59:05
stddef-h: Make 'unreachable' usable in C++ mode. Reported by Pierre Ossman <ossman@cendio.se> at <https://savannah.gnu.org/bugs/?67152>. * m4/stddef_h.m4 (gl_STDDEF_H): Also test whether unreachable is defined by <stddef.h> in C++ mode. * lib/stddef.in.h: In C++ mode, include <utility> and either import 'unreachable' from the std namespace or define it as an inline function. * tests/test-stddef-h.c: Disable some tests in C++ mode. * tests/test-stddef-h-c++.cc: Perform nearly the same tests in C++ mode as in C mode. * tests/test-stddef-h-c++2.cc: Rename some variables. Disable the NULL test with clang on Windows. * tests/test-stddef-h-c++3.cc: New file. * modules/stddef-h-c++-tests (Files): Include it. (Makefile.am): Link test-stddef-h-c++ with test-stddef-h-c++3.o.
Files:
tests/test-stddef-h-c++.cc
tests/test-stddef-h-c++2.cc
tests/test-stddef-h-c++3.cc
Status:
c++-test
Depends-on:
ansi-c++-opt
configure.ac:
Makefile.am:
if ANSICXX
TESTS += test-stddef-h-c++
check_PROGRAMS += test-stddef-h-c++
test_stddef_h_c___SOURCES = test-stddef-h-c++.cc test-stddef-h-c++2.cc test-stddef-h-c++3.cc
endif