OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [initlist56.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/47453
2
// { dg-options "-std=c++0x -pedantic-errors" }
3
 
4
// invalid
5
int a({0});                     // { dg-error "" }
6
 
7
// invalid
8
int const &b({0});             // { dg-error "" }
9
 
10
// invalid
11
struct A1 { int a[2]; A1(); };
12
A1::A1():a({1, 2}) { }          // { dg-error "" }
13
 
14
struct A { explicit A(int, int); A(int, long); };
15
 
16
// invalid
17
A c({1, 2});                    // { dg-error "" }
18
 
19
// valid (by copy constructor).
20
A d({1, 2L});
21
 
22
// valid
23
A e{1, 2};
24
 
25
#include 
26
 
27
struct B {
28
  template
29
  B(std::initializer_list, T ...);
30
};
31
 
32
// invalid (the first phase only considers init-list ctors)
33
// (for the second phase, no constructor is viable)
34
B f{1, 2, 3};                   // { dg-error "" }
35
 
36
// valid (T deduced to <>).
37
B g({1, 2, 3});

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.