summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-08-28 21:55:00 +0000
committerEric Fiselier <eric@efcs.ca>2016-08-28 21:55:00 +0000
commit040411762fde039dcd1a7f513d95d01266bfa94d (patch)
tree338fa1d4c00cf3359ee9a454ba34b53d073ca798 /libcxx/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp
parent61c0b0c32a0a14003f65c84d3bceec7eb3c10c3d (diff)
downloadbcm5719-llvm-040411762fde039dcd1a7f513d95d01266bfa94d.tar.gz
bcm5719-llvm-040411762fde039dcd1a7f513d95d01266bfa94d.zip
Mark LWG 2716 as complete - shuffle and sample disallows lvalue URNGs.
Libc++'s implementation of shuffle and sample already support lvalue and rvalue RNG's. This patch adds tests for both categories and marks the issue as complete. This patch also contains drive-by change for std::experimental::sample which improves the diagnostics produced when the correct iterator categories are not supplied. llvm-svn: 279947
Diffstat (limited to 'libcxx/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp')
-rw-r--r--libcxx/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libcxx/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp b/libcxx/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp
index eeb43737932..b27135ac7c0 100644
--- a/libcxx/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp
+++ b/libcxx/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp
@@ -32,5 +32,8 @@ template <class PopulationIterator, class SampleIterator> void test() {
}
int main() {
+ // expected-error@experimental/algorithm:* {{static_assert failed "SampleIterator must meet the requirements of RandomAccessIterator"}}
+ // expected-error@experimental/algorithm:* 2 {{does not provide a subscript operator}}
+ // expected-error@experimental/algorithm:* {{invalid operands}}
test<input_iterator<int *>, output_iterator<int *> >();
}
OpenPOWER on IntegriCloud