1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // <valarray>
11 
12 // template<class T> class valarray;
13 
14 // valarray();
15 
16 #include <valarray>
17 #include <cassert>
18 
19 struct S {
SS20     S() { ctor_called = true; }
21     static bool ctor_called;
22 };
23 
24 bool S::ctor_called = false;
25 
main()26 int main()
27 {
28     {
29         std::valarray<int> v;
30         assert(v.size() == 0);
31     }
32     {
33         std::valarray<float> v;
34         assert(v.size() == 0);
35     }
36     {
37         std::valarray<double> v;
38         assert(v.size() == 0);
39     }
40     {
41         std::valarray<std::valarray<double> > v;
42         assert(v.size() == 0);
43     }
44     {
45         std::valarray<S> v;
46         assert(v.size() == 0);
47         assert(!S::ctor_called);
48     }
49 }
50