+2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/69637
+ * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
+ to the width.
+
2017-01-31 Jakub Jelinek <jakub@redhat.com>
PR c++/79304
&& !INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (width)))
error ("width of bit-field %qD has non-integral type %qT", value,
TREE_TYPE (width));
- DECL_INITIAL (value) = width;
- SET_DECL_C_BIT_FIELD (value);
+ else
+ {
+ DECL_INITIAL (value) = width;
+ SET_DECL_C_BIT_FIELD (value);
+ }
}
DECL_IN_AGGR_P (value) = 1;
+2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/69637
+ * g++.dg/cpp0x/pr69637-1.C: New.
+ * g++.dg/cpp0x/pr69637-2.C: Likewise.
+
2017-02-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* gcc.target/s390/s390.exp: Rename __S390_VX__ to __VX__.
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+template <class T>
+int foo () { return 1; }
+
+struct B {
+ unsigned c: foo; // { dg-error "non-integral type" }
+};
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+template <class T, int N>
+constexpr int foo () { return N; }
+
+struct B { unsigned c: foo<int>, 3(); }; // { dg-error "non-integral type|expected" }