summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/enum.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/enum.cpp')
-rw-r--r--test/SemaCXX/enum.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/SemaCXX/enum.cpp b/test/SemaCXX/enum.cpp
index dc4a506..bfb5784 100644
--- a/test/SemaCXX/enum.cpp
+++ b/test/SemaCXX/enum.cpp
@@ -1,5 +1,4 @@
// RUN: %clang_cc1 -fsyntax-only -pedantic -std=c++98 -verify -triple x86_64-apple-darwin %s
-
enum E {
Val1,
Val2
@@ -71,3 +70,12 @@ namespace PR6061 {
namespace Conditional {
enum a { A }; a x(const enum a x) { return 1?x:A; }
}
+
+namespace PR7051 {
+ enum E { e0 };
+ void f() {
+ E e;
+ e = 1; // expected-error{{assigning to 'PR7051::E' from incompatible type 'int'}}
+ e |= 1; // expected-error{{assigning to 'PR7051::E' from incompatible type 'int'}}
+ }
+}
OpenPOWER on IntegriCloud