summaryrefslogtreecommitdiffstats
path: root/test/Sema/warn-outof-range-assign-enum.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/warn-outof-range-assign-enum.c')
-rw-r--r--test/Sema/warn-outof-range-assign-enum.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Sema/warn-outof-range-assign-enum.c b/test/Sema/warn-outof-range-assign-enum.c
index 2e79e66..43eea0c 100644
--- a/test/Sema/warn-outof-range-assign-enum.c
+++ b/test/Sema/warn-outof-range-assign-enum.c
@@ -21,6 +21,18 @@ enum Test2 test2(enum Test2 *t) {
return 10; // expected-warning {{integer constant not in range of enumerated type 'enum Test2'}}
}
+// PR15069
+typedef enum
+{
+ a = 0
+} T;
+
+void f()
+{
+ T x = a;
+ x += 1; // expected-warning {{integer constant not in range of enumerated type}}
+}
+
int main() {
CCTestEnum test = 1; // expected-warning {{integer constant not in range of enumerated type 'CCTestEnum'}}
test = 600; // expected-warning {{integer constant not in range of enumerated type 'CCTestEnum'}}
OpenPOWER on IntegriCloud