Make sure to count the struct elements correctly; here, we want the
member count. The count returned by numStructUnionElements is the
number of initializers that will be consumed, not the number of members
to iterate through. Fixes PR2534.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54601 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/unnamed-bitfield-init.c b/test/Sema/unnamed-bitfield-init.c
new file mode 100644
index 0000000..3a3869a
--- /dev/null
+++ b/test/Sema/unnamed-bitfield-init.c
@@ -0,0 +1,6 @@
+// RUN: clang -fsyntax-only -verify %s
+typedef struct {
+ int a; int : 24; char b;
+} S;
+
+S a = { 1, 2 };