* tree.c (rvalue): Convert bitfields to their declared types.
PR c++/27292
* g++.dg/conversion/bitfield4.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113339
138bc75d-0d04-0410-961f-
82ee72b054a4
2006-04-27 Mark Mitchell <mark@codesourcery.com>
+ PR c++/27292
+ * tree.c (rvalue): Convert bitfields to their declared types.
+
PR c++/27102
* typeck2.c (cxx_incomplete_type_diagnostic): Handle
TYPENAME_TYPE.
if (real_lvalue_p (expr))
{
type = is_bitfield_expr_with_lowered_type (expr);
- if (!type)
- type = TREE_TYPE (expr);
+ if (type)
+ return cp_convert (TYPE_MAIN_VARIANT (type), expr);
+ type = TREE_TYPE (expr);
/* [basic.lval]
Non-class rvalues always have cv-unqualified types. */
+2006-04-27 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27292
+ * g++.dg/conversion/bitfield4.C: New test.
+
2006-04-27 Eric Christopher <echristo@apple.com>
* gcc.dg/pragma-ms_struct.c: New.
--- /dev/null
+// PR c++/27292
+
+enum ColorRole
+{
+ WindowText, Button
+};
+
+struct QPalette {
+
+ColorRole bg_role:8;
+
+ bool hasBackground();
+};
+
+
+bool
+QPalette::hasBackground ()
+{
+ return (ColorRole (bg_role) != WindowText);
+}