Clang Project

clang_source_code/test/SemaCXX/PR38235.cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
2
3enum class E { Foo, Bar = 97119 };
4
5void f() __attribute__((constructor(E::Foo))); // expected-error{{'constructor' attribute requires an integer constant}}
6void f2() __attribute__((constructor(E::Bar)));// expected-error{{'constructor' attribute requires an integer constant}}
7
8void switch_me(E e) {
9  switch (e) {
10    case E::Foo:
11    case E::Bar:
12      break;
13  }
14}
15
16enum class E2;
17
18struct S {
19  static const E e = E::Foo;
20};
21