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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [forw_enum5.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
namespace one
5
{
6
    struct S
7
    {
8
        enum { A = 1, B = 2 };
9
        struct T
10
        {
11
            enum { B = 102 };
12
 
13
            enum class E1;
14
            enum E2 : int;
15
        };
16
    };
17
 
18
    enum class S::T::E1 { A1 = A, B1 = B, C1 };
19
    enum S::T::E2 : int { A1 = A, B1 = B, C1 };
20
 
21
    static_assert(int(S::T::E1::A1) == 1, "error");
22
    static_assert(int(S::T::E1::B1) == 102, "error");
23
    static_assert(int(S::T::E1::C1) == 103, "error");
24
 
25
    static_assert(int(S::T::E2::A1) == 1, "error");
26
    static_assert(int(S::T::E2::B1) == 102, "error");
27
    static_assert(int(S::T::E2::C1) == 103, "error");
28
    static_assert(int(S::T::A1) == 1, "error");
29
    static_assert(int(S::T::B1) == 102, "error");
30
    static_assert(int(S::T::C1) == 103, "error");
31
}
32
 
33
 
34
namespace two
35
{
36
    namespace S
37
    {
38
        enum { A = 1, B = 2 };
39
        namespace T
40
        {
41
            enum { B = 102 };
42
 
43
            enum class E1;
44
            enum E2 : int;
45
        }
46
    }
47
 
48
    enum class S::T::E1 { A1 = A, B1 = B, C1 };
49
    enum S::T::E2 : int { A1 = A, B1 = B, C1 };
50
 
51
    static_assert(int(S::T::E1::A1) == 1, "error");
52
    static_assert(int(S::T::E1::B1) == 102, "error");
53
    static_assert(int(S::T::E1::C1) == 103, "error");
54
 
55
    static_assert(int(S::T::E2::A1) == 1, "error");
56
    static_assert(int(S::T::E2::B1) == 102, "error");
57
    static_assert(int(S::T::E2::C1) == 103, "error");
58
    static_assert(int(S::T::A1) == 1, "error");
59
    static_assert(int(S::T::B1) == 102, "error");
60
    static_assert(int(S::T::C1) == 103, "error");
61
}
62
 
63
 

powered by: WebSVN 2.1.0

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