libstdc++: Fix some tests that fail in C++20 mode
authorJonathan Wakely <jwakely@redhat.com>
Mon, 12 Apr 2021 10:45:21 +0000 (11:45 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 12 Apr 2021 11:30:07 +0000 (12:30 +0100)
The linear_congruential_engine negative tests fail with a different
error in C++20 mode, because double is no longer an invalid type for
NTTP. Adjust the expected errors.

libstdc++-v3/ChangeLog:

* testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc:
Adjust expected error for C++20 mode.
* testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/non_uint_neg.cc:
Likewise.

libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/non_uint_neg.cc
libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/linear_congruential/requirements/non_uint_neg.cc

index e04e8ca..a36d63c 100644 (file)
 
 // { dg-do compile { target c++11 } }
 // { dg-require-cstdint "" }
+// { dg-error "not a valid type" "" { target { ! c++20 } } 31 }
+// { dg-error "from 'int' to 'double'" "" { target c++20 } 31 }
 
 // 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
 // 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
 
 #include <random>
 
-std::linear_congruential_engine<double, 48271, 0, 2147483647> x; // { dg-error "not a valid type" }
+std::linear_congruential_engine<double, 48271, 0, 2147483647> x;
index 5ad82db..53b15f3 100644 (file)
@@ -19,7 +19,8 @@
 
 // { dg-do compile }
 // { dg-options "-D_GLIBCXX_CONCEPT_CHECKS" }
-// { dg-error "not a valid type" "" { target *-*-* } 29 }
+// { dg-error "not a valid type" "" { target { ! c++20 } } 30 }
+// { dg-error "from 'int' to 'double'" "" { target c++20 } 30 }
 
 // 5.1.4.1 class template linear_congruential [tr.rand.eng.lcong]
 // 5.1.4.1 [4]