1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // UNSUPPORTED: c++03
10 
11 // <random>
12 
13 #include <random>
14 
15 template<class Int>
16 struct G {
17   using result_type = Int;
18   result_type operator()();
minG19   static constexpr result_type min() { return 0; }
maxG20   static constexpr result_type max() { return 255; }
21 };
22 
test(std::binomial_distribution<int> dist)23 void test(std::binomial_distribution<int> dist)
24 {
25   G<int> badg;
26   G<unsigned> okg;
27 
28   dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
29   dist(okg);
30 }
31