summaryrefslogtreecommitdiff
path: root/test/SemaCXX/PR38235.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/PR38235.cpp')
-rw-r--r--test/SemaCXX/PR38235.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/SemaCXX/PR38235.cpp b/test/SemaCXX/PR38235.cpp
new file mode 100644
index 0000000000000..c3fd38ab04d6a
--- /dev/null
+++ b/test/SemaCXX/PR38235.cpp
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
+
+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;
+ }
+}
+
+enum class E2;
+
+struct S {
+ static const E e = E::Foo;
+};