summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/scoped_enum2.C
blob: c4a869a6539e15cb6fdcced4f6761cdad15aea36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// { dg-do compile { target c++11 } }

enum class E { e = 10 };
enum E2 { e2 = 10 };

struct C {
  int arr[E::e];    // { dg-error "could not convert" }
// { dg-error "14:size of array .arr. has non-integral" "" { target c++11 } .-1 }
  int arr2[E2::e2]; // OK
  int i: E::e;	    // { dg-error "could not convert|non-integral type" }
  int i2: E2::e2;   // OK
};