[committed] libstdc++: Make some #error strings consistent with other tests

Jonathan Wakely jwakely@redhat.com
Thu Aug 12 18:49:33 GMT 2021


Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* testsuite/26_numerics/lerp.cc: Add header name to #error.
	* testsuite/26_numerics/midpoint/integral.cc: Likewise.
	* testsuite/26_numerics/midpoint/version.cc: New test.

Tested powerpc64le-linux. Committed to trunk.

-------------- next part --------------
commit b1c0e8599aa6ff5550dc748679e13c1eb492ee2c
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Aug 12 18:02:40 2021

    libstdc++: Make some #error strings consistent with other tests
    
    Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
    
    libstdc++-v3/ChangeLog:
    
            * testsuite/26_numerics/lerp.cc: Add header name to #error.
            * testsuite/26_numerics/midpoint/integral.cc: Likewise.
            * testsuite/26_numerics/midpoint/version.cc: New test.

diff --git a/libstdc++-v3/testsuite/26_numerics/lerp.cc b/libstdc++-v3/testsuite/26_numerics/lerp.cc
index e456b8203a5..d74b745abb9 100644
--- a/libstdc++-v3/testsuite/26_numerics/lerp.cc
+++ b/libstdc++-v3/testsuite/26_numerics/lerp.cc
@@ -21,9 +21,9 @@
 #include <cmath>
 
 #ifndef __cpp_lib_interpolate
-# error "Feature-test macro for midpoint and lerp missing"
+# error "Feature-test macro for midpoint and lerp missing in <cmath>"
 #elif __cpp_lib_interpolate != 201902L
-# error "Feature-test macro for midpoint and lerp has wrong value"
+# error "Feature-test macro for midpoint and lerp has wrong value in <cmath>"
 #endif
 
 #include <limits>
diff --git a/libstdc++-v3/testsuite/26_numerics/midpoint/integral.cc b/libstdc++-v3/testsuite/26_numerics/midpoint/integral.cc
index 1094b668144..d74279ea4b3 100644
--- a/libstdc++-v3/testsuite/26_numerics/midpoint/integral.cc
+++ b/libstdc++-v3/testsuite/26_numerics/midpoint/integral.cc
@@ -21,9 +21,9 @@
 #include <numeric>
 
 #ifndef __cpp_lib_interpolate
-# error "Feature-test macro for midpoint and lerp missing"
+# error "Feature-test macro for midpoint and lerp missing in <numeric>"
 #elif __cpp_lib_interpolate != 201902L
-# error "Feature-test macro for midpoint and lerp has wrong value"
+# error "Feature-test macro for midpoint and lerp has wrong value in <numeric>"
 #endif
 
 #include <climits>
diff --git a/libstdc++-v3/testsuite/26_numerics/midpoint/version.cc b/libstdc++-v3/testsuite/26_numerics/midpoint/version.cc
new file mode 100644
index 00000000000..3ccb032bc67
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/midpoint/version.cc
@@ -0,0 +1,10 @@
+// { dg-options "-std=gnu++2a" }
+// { dg-do preprocess { target c++2a } }
+
+#include <version>
+
+#ifndef __cpp_lib_interpolate
+# error "Feature-test macro for midpoint and lerp missing in <version>"
+#elif __cpp_lib_interpolate != 201902L
+# error "Feature-test macro for midpoint and lerp has wrong value in <version>"
+#endif


More information about the Gcc-patches mailing list