aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/forw_enum11.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/forw_enum11.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/forw_enum11.C23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/forw_enum11.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/forw_enum11.C
new file mode 100644
index 000000000..8cabc038f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/forw_enum11.C
@@ -0,0 +1,23 @@
+// { dg-do compile { target c++11 } }
+
+enum { A = 1 };
+struct T
+{
+ int i1, i2, i3, i4, i5, i6, i7;
+ enum E2 : int;
+
+ void f();
+};
+
+enum T::E2 : int { A1 = A, A2 = 23 };
+
+static_assert(int(T::A1) == 1, "error");
+static_assert(int(T::A2) == 23, "error");
+
+void T::f()
+{
+ static_assert(int(T::A1) == 1, "error");
+ static_assert(int(T::A2) == 23, "error");
+ static_assert(int(A1) == 1, "error");
+ static_assert(int(A2) == 23, "error");
+}