summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/initlist36.C
blob: 94624c977c92ecb7c1efe61d9437dda237523cf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// PR c++/44358
// { dg-options "-std=c++0x" }

#include <initializer_list>

struct A
{
  A(int);
};

struct B
{
  B(std::initializer_list<A>);
};

void f (B b);
int main()
{
  B b0 = {{1}};
  B b1 = {{1.0}};		// { dg-error "narrowing" }
  B b2 {1.0};			// { dg-error "narrowing" }
  A a {1.0};			// { dg-error "narrowing" }
}