aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/enum-scoped.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/enum-scoped.cpp')
-rw-r--r--test/SemaCXX/enum-scoped.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaCXX/enum-scoped.cpp b/test/SemaCXX/enum-scoped.cpp
index 8c4bfe72d3e2..fc871cf37920 100644
--- a/test/SemaCXX/enum-scoped.cpp
+++ b/test/SemaCXX/enum-scoped.cpp
@@ -109,3 +109,13 @@ void PR9333() {
scoped_enum e = scoped_enum::yes;
if (e == scoped_enum::no) { }
}
+
+// <rdar://problem/9366066>
+namespace rdar9366066 {
+ enum class X : unsigned { value };
+
+ void f(X x) {
+ x % X::value; // expected-error{{invalid operands to binary expression ('rdar9366066::X' and 'rdar9366066::X')}}
+ x % 8; // expected-error{{invalid operands to binary expression ('rdar9366066::X' and 'int')}}
+ }
+}