
This was approved for C++26 last week at the WG21 meeting in Kona. libstdc++-v3/ChangeLog: * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * include/bits/version.def (saturation_arithmetic): Define. * include/bits/version.h: Regenerate. * include/std/numeric: Include new header. * include/bits/sat_arith.h: New file. * testsuite/26_numerics/saturation/add.cc: New test. * testsuite/26_numerics/saturation/cast.cc: New test. * testsuite/26_numerics/saturation/div.cc: New test. * testsuite/26_numerics/saturation/mul.cc: New test. * testsuite/26_numerics/saturation/sub.cc: New test. * testsuite/26_numerics/saturation/version.cc: New test.
19 lines
667 B
C++
19 lines
667 B
C++
// { dg-do preprocess { target c++26 } }
|
|
// { dg-add-options no_pch }
|
|
|
|
#include <numeric>
|
|
|
|
#ifndef __cpp_lib_saturation_arithmetic
|
|
# error "Feature test macro for saturation arithmetic is missing in <numeric>"
|
|
#elif __cpp_lib_saturation_arithmetic < 202311L
|
|
# error "Feature test macro for saturation arithmetic has wrong value in <numeric>"
|
|
#endif
|
|
|
|
#undef __cpp_lib_saturation_arithmetic
|
|
#include <version>
|
|
|
|
#ifndef __cpp_lib_saturation_arithmetic
|
|
# error "Feature test macro for saturation arithmetic is missing in <version>"
|
|
#elif __cpp_lib_saturation_arithmetic < 202311L
|
|
# error "Feature test macro for saturation arithmetic has wrong value in <version>"
|
|
#endif
|