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

Subversion Repositories openrisc

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

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
struct S1
5
{
6
    struct S2
7
    {
8
        // opaque enum declarations
9
        enum class E1;
10
        enum class E2 : int;
11
        enum class E3 : short;
12
        enum E4 : int;
13
        enum E5 : short;
14
 
15
        // can be repeated
16
        enum class E1;
17
        enum class E2 : int;
18
        enum class E3 : short;
19
        enum E4 : int;
20
        enum E5 : short;
21
    };
22
};
23
 
24
// are complete so we can declare variables
25
S1::S2::E1 b1;
26
S1::S2::E2 b2;
27
S1::S2::E3 b3;
28
S1::S2::E4 b4;
29
S1::S2::E5 b5;
30
 
31
//even with elaborated-type-specifiers
32
enum S1::S2::E1 a1;
33
enum S1::S2::E2 a2;
34
enum S1::S2::E3 a3;
35
enum S1::S2::E4 a4;
36
enum S1::S2::E5 a5;
37
 
38
// and the list can be added later
39
enum class S1::S2::E1 { e11, e12 };
40
enum class S1::S2::E2 : int { e21, e22 };
41
enum class S1::S2::E3 : short {e31, e32 };
42
enum S1::S2::E4 : int { e41, e42 };
43
enum S1::S2::E5 : short { e51, e52 };
44
 

powered by: WebSVN 2.1.0

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