blob: 1228d300d144059a534dc4df1ccc5a0c0e0448ce [file] [log] [blame]
Richard Smith762bb9d2011-10-13 22:29:44 +00001// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
Sebastian Redlce7cd262011-05-20 21:07:01 +00002// XFAIL: *
3
4template <typename T, typename U>
5struct same_type { static const bool value = false; };
6template <typename T>
7struct same_type<T, T> { static const bool value = true; };
8
9namespace std {
10 typedef decltype(sizeof(int)) size_t;
11
12 // libc++'s implementation
13 template <class _E>
14 class initializer_list
15 {
16 const _E* __begin_;
17 size_t __size_;
18
19 initializer_list(const _E* __b, size_t __s)
20 : __begin_(__b),
21 __size_(__s)
22 {}
23
24 public:
25 typedef _E value_type;
26 typedef const _E& reference;
27 typedef const _E& const_reference;
28 typedef size_t size_type;
29
30 typedef const _E* iterator;
31 typedef const _E* const_iterator;
32
33 initializer_list() : __begin_(nullptr), __size_(0) {}
34
35 size_t size() const {return __size_;}
36 const _E* begin() const {return __begin_;}
37 const _E* end() const {return __begin_ + __size_;}
38 };
39}
40
Sebastian Redl262b62b2011-06-05 12:23:08 +000041namespace litb {
42
43 // invalid
44 struct A { int a[2]; A():a({1, 2}) { } }; // expected-error {{}}
45
46 // invalid
47 int a({0}); // expected-error {{}}
48
49 // invalid
50 int const &b({0}); // expected-error {{}}
51
Sebastian Redl262b62b2011-06-05 12:23:08 +000052}