aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/bitfld-14.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/bitfld-14.c')
-rw-r--r--gcc/testsuite/gcc.dg/bitfld-14.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/bitfld-14.c b/gcc/testsuite/gcc.dg/bitfld-14.c
new file mode 100644
index 00000000000..eca0b03def0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/bitfld-14.c
@@ -0,0 +1,11 @@
+/* Test for non-integer bit-field widths. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+enum e { E, F };
+struct s {
+ int a : (void *)4; /* { dg-error "error: bit-field 'a' width not an integer constant" } */
+ int b : (enum e)F;
+ int c : (_Bool)1;
+};