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

Subversion Repositories openrisc

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// { dg-options "-std=c++0x" }
3
 
4
enum class E1 : int; // { dg-error "previous definition" }
5
enum E1 : int;  // { dg-error "scoped/unscoped mismatch" }
6
 
7
enum E2 : int; // { dg-error "previous definition" }
8
enum class E2 : int;  // { dg-error "scoped/unscoped mismatch" }
9
 
10
enum struct E3 : int;
11
enum class E3 : int; //ok
12
 
13
enum class E4 : int; // { dg-error "previous definition" }
14
enum class E4 : long;  // { dg-error "different underlying type" }
15
 
16
enum E5 : int; // { dg-error "previous definition" }
17
enum E5 : long;  // { dg-error "different underlying type" }
18
 
19
enum E6 : int;
20
enum E6 : int; //ok
21
 
22
enum class E7;
23
enum class E7 : int; //ok
24
 
25
enum class E3 e3; // { dg-warning "scoped enum must not use" }
26
enum struct E3 e4; // { dg-warning "scoped enum must not use" }
27
enum E5 : int e5; // { dg-error "expected|invalid type" }
28
 
29
enum E6 : int { a, b, c }; // { dg-error "previous definition" }
30
enum E6 : int { a, b, c }; // { dg-error "multiple definition" }
31
 
32
enum class E7 { }; // { dg-error "previous definition" }
33
enum class E7 { a, b, c }; // { dg-error "multiple definition" }
34
 
35
namespace N1
36
{
37
    struct D;
38
    enum class E6;
39
    enum E7 : int;
40
}
41
 
42
enum class N1::E6; // { dg-error "must use a simple identifier" }
43
enum N1::E6 e6_1; //ok
44
enum ::N1::E6 e6_2; //ok
45
 
46
namespace N2
47
{
48
    enum class N1::E6 { e1, e2, e3 }; // { dg-error "does not enclose" }
49
    enum N1::E7 : int { e1, e2, e3 }; // { dg-error "does not enclose" }
50
};
51
 
52
enum class N1::E6 { e1, e2, e3 };
53
enum N1::E7 : int { e1, e2, e3 };
54
 
55
struct S1
56
{
57
    struct D;
58
    enum class E6;
59
    enum E7 : int;
60
};
61
 
62
enum class S1::E6; // { dg-error "must use a simple identifier" }
63
enum S1::E6 e6_3; //ok
64
enum ::S1::E6 e6_4; //ok
65
 
66
struct S2
67
{
68
    enum class S1::E6 { e1, e2, e3 }; // { dg-error "does not enclose" }
69
    enum S1::E7 : int { e1, e2, e3 }; // { dg-error "does not enclose" }
70
};
71
 
72
enum class S1::E6 { e1, e2, e3 };
73
enum S1::E7 : int { e1, e2, e3 };
74
 

powered by: WebSVN 2.1.0

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