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] - Rev 701

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

// { dg-do compile }
// { dg-options "-std=c++0x" }

namespace one
{
    struct S
    {
        enum { A = 1, B = 2 };
        struct T
        {
            enum { B = 102 };

            enum class E1;
            enum E2 : int;
        };
    };

    enum class S::T::E1 { A1 = A, B1 = B, C1 };
    enum S::T::E2 : int { A1 = A, B1 = B, C1 };

    static_assert(int(S::T::E1::A1) == 1, "error");
    static_assert(int(S::T::E1::B1) == 102, "error");
    static_assert(int(S::T::E1::C1) == 103, "error");

    static_assert(int(S::T::E2::A1) == 1, "error");
    static_assert(int(S::T::E2::B1) == 102, "error");
    static_assert(int(S::T::E2::C1) == 103, "error");
    static_assert(int(S::T::A1) == 1, "error");
    static_assert(int(S::T::B1) == 102, "error");
    static_assert(int(S::T::C1) == 103, "error");
}


namespace two
{
    namespace S
    {
        enum { A = 1, B = 2 };
        namespace T
        {
            enum { B = 102 };

            enum class E1;
            enum E2 : int;
        }
    }

    enum class S::T::E1 { A1 = A, B1 = B, C1 };
    enum S::T::E2 : int { A1 = A, B1 = B, C1 };

    static_assert(int(S::T::E1::A1) == 1, "error");
    static_assert(int(S::T::E1::B1) == 102, "error");
    static_assert(int(S::T::E1::C1) == 103, "error");

    static_assert(int(S::T::E2::A1) == 1, "error");
    static_assert(int(S::T::E2::B1) == 102, "error");
    static_assert(int(S::T::E2::C1) == 103, "error");
    static_assert(int(S::T::A1) == 1, "error");
    static_assert(int(S::T::B1) == 102, "error");
    static_assert(int(S::T::C1) == 103, "error");
}


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

powered by: WebSVN 2.1.0

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