PR c++/31513
* call.c (convert_for_arg_passing): Convert bitfields to their
declared types.
PR c++/31513
* g++.dg/expr/bitfield8.C: New test.
From-SVN: r123939
+2007-04-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/31513
+ * call.c (convert_for_arg_passing): Convert bitfields to their
+ declared types.
+
2007-04-17 Simon Martin <simartin@users.sourceforge.net>
PR c++/31517
tree
convert_for_arg_passing (tree type, tree val)
{
+ val = convert_bitfield_to_declared_type (val);
if (val == error_mark_node)
;
/* Pass classes with copy ctors by invisible reference. */
+2007-04-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/31513
+ * g++.dg/expr/bitfield8.C: New test.
+
2007-04-17 Joseph Myers <joseph@codesourcery.com>
Richard Sandiford <richard@codesourcery.com>
--- /dev/null
+// PR c++/31513
+// { dg-do run }
+
+extern "C" void abort();
+
+struct tree_type {
+ unsigned int precision : 9;
+};
+
+void bork(unsigned int i) {
+ if (i != 7)
+ abort();
+}
+
+void foo(struct tree_type *t)
+{
+ bork(t->precision);
+}
+
+int main() {
+ tree_type t;
+ t.precision = 7;
+ foo(&t);
+}