2018-07-24 05:08:13 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
|
2018-07-21 01:42:09 +08:00
|
|
|
|
|
|
|
enum class E { Foo, Bar = 97119 };
|
|
|
|
|
|
|
|
void f() __attribute__((constructor(E::Foo))); // expected-error{{'constructor' attribute requires an integer constant}}
|
|
|
|
void f2() __attribute__((constructor(E::Bar)));// expected-error{{'constructor' attribute requires an integer constant}}
|
|
|
|
|
|
|
|
void switch_me(E e) {
|
|
|
|
switch (e) {
|
|
|
|
case E::Foo:
|
|
|
|
case E::Bar:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2018-07-24 05:08:13 +08:00
|
|
|
|
|
|
|
enum class E2;
|
|
|
|
|
|
|
|
struct S {
|
|
|
|
static const E e = E::Foo;
|
|
|
|
};
|