summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/conversion/enum1.C
blob: 6ea8cadb64293e30c594cfb8c167e9abe249f536 (plain)
1
2
3
4
5
6
7
8
9
10
// { dg-do run }
// { dg-options "-O2 -finline-functions" }

enum E { V = 1 };
static const E E_MIN = V;
static const E E_MAX = V;

bool valid(E v) { return v >= E_MIN && v <= E_MAX; }

int main() { return valid(E(2)); }