More std::initializer_list tests.

llvm-svn: 132663
This commit is contained in:
Sebastian Redl 2011-06-05 12:23:21 +00:00
parent 3da3489e49
commit f08872fb29
1 changed files with 3 additions and 1 deletions

View File

@ -67,8 +67,11 @@ namespace integral {
}
void initializer_list() {
std::initializer_list<int> il = { 1, 2, 3 };
std::initializer_list<double> dl = { 1.0, 2.0, 3 };
auto l = {1, 2, 3, 4};
static_assert(same_type<decltype(l), std::initializer_list<int>>::value, "");
auto bl = {1, 2.0}; // expected-error {{cannot deduce}}
for (int i : {1, 2, 3, 4}) {}
}
@ -91,7 +94,6 @@ namespace objects {
};
void initialization() {
// FIXME: how to ensure correct overloads are called?
{ A<0> a{}; }
{ A<0> a = {}; }
{ A<1> a{1, 1.0}; }