FreeBSD/contrib/gcc/cp/typeck.c
/* If EXP is a reference to a bitfield, and the type of EXP does not
   match the declared type of the bitfield, return the declared type
   of the bitfield.  Otherwise, return NULL_TREE.  */
If EXP is a reference to a bitfield, and the type of EXP does not
match the declared type of the bitfield, return the declared type
of the bitfield.
If EXP is a reference to a bitfield and the type of EXP does not match the declared type of the bitfield return the declared type of the bitfield .
tree
is_bitfield_expr_with_lowered_type (tree exp)
{
  switch (TREE_CODE (exp))
    {
    case COND_EXPR:
      if (!is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 1)))
	return NULL_TREE;
      return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 2));
    case COMPOUND_EXPR:
      return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 1));
    case MODIFY_EXPR:
    case SAVE_EXPR:
      return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 0));
    case COMPONENT_REF:
      {
	tree field;
	field = TREE_OPERAND (exp, 1);
	if (TREE_CODE (field) != FIELD_DECL || !DECL_C_BIT_FIELD (field))
	  return NULL_TREE;
	if (same_type_ignoring_top_level_qualifiers_p
	    (TREE_TYPE (exp), DECL_BIT_FIELD_TYPE (field)))
	  return NULL_TREE;
	return DECL_BIT_FIELD_TYPE (field);
      }
    default:
      return NULL_TREE;
    }
}
tree is_bitfield_expr_with_lowered_type ( tree exp ) { switch ( TREE_CODE ( exp ) ) { case COND_EXPR : if ( ! is_bitfield_expr_with_lowered_type ( TREE_OPERAND ( exp , 1 ) ) ) return NULL_TREE ; return is_bitfield_expr_with_lowered_type ( TREE_OPERAND ( exp , 2 ) ) ; case COMPOUND_EXPR : return is_bitfield_expr_with_lowered_type ( TREE_OPERAND ( exp , 1 ) ) ; case MODIFY_EXPR : case SAVE_EXPR : return is_bitfield_expr_with_lowered_type ( TREE_OPERAND ( exp , 0 ) ) ; case COMPONENT_REF : { tree field ; field = TREE_OPERAND ( exp , 1 ) ; if ( TREE_CODE ( field ) != FIELD_DECL || ! DECL_C_BIT_FIELD ( field ) ) return NULL_TREE ; if ( same_type_ignoring_top_level_qualifiers_p ( TREE_TYPE ( exp ) , DECL_BIT_FIELD_TYPE ( field ) ) ) return NULL_TREE ; return DECL_BIT_FIELD_TYPE ( field ) ; } default : return NULL_TREE ; } }
If EXP is a reference to a bitfield, and the type of EXP does not
match the declared type of the bitfield, return the declared type
of the bitfield.
If EXP is a reference to a bitfield and the type of EXP does not match the declared type of the bitfield return the declared type of the bitfield .