initializer_list.pass.cpp revision b64f8b07c104c6cc986570ac8ee0ed16a9f23976
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// <list>
11
12// list(initializer_list<value_type> il);
13
14#include <list>
15#include <cassert>
16
17int main()
18{
19#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
20    std::list<int> d = {3, 4, 5, 6};
21    assert(d.size() == 4);
22    std::list<int>::iterator i = d.begin();
23    assert(*i++ == 3);
24    assert(*i++ == 4);
25    assert(*i++ == 5);
26    assert(*i++ == 6);
27#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
28}
29