libstdc++: Make some #error strings consistent with other tests
authorJonathan Wakely <jwakely@redhat.com>
Thu, 12 Aug 2021 17:02:40 +0000 (18:02 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 12 Aug 2021 18:46:16 +0000 (19:46 +0100)
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.

libstdc++-v3/testsuite/26_numerics/lerp.cc
libstdc++-v3/testsuite/26_numerics/midpoint/integral.cc
libstdc++-v3/testsuite/26_numerics/midpoint/version.cc [new file with mode: 0644]

index e456b82..d74b745 100644 (file)
@@ -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>
index 1094b66..d74279e 100644 (file)
@@ -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 (file)
index 0000000..3ccb032
--- /dev/null
@@ -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