FreeBSD/contrib/gcc/cp/typeck.c
/* Process a sizeof expression where the operand is an expression.  */
Process a sizeof expression where the operand is an expression.
Process a sizeof expression where the operand is an expression .
static tree
cxx_sizeof_expr (tree e)
{
  if (e == error_mark_node)
    return error_mark_node;
  if (processing_template_decl)
    {
      e = build_min (SIZEOF_EXPR, size_type_node, e);
      TREE_SIDE_EFFECTS (e) = 0;
      TREE_READONLY (e) = 1;
      return e;
    }
  if (TREE_CODE (e) == COMPONENT_REF
      && TREE_CODE (TREE_OPERAND (e, 1)) == FIELD_DECL
      && DECL_C_BIT_FIELD (TREE_OPERAND (e, 1)))
    {
      error ("invalid application of %<sizeof%> to a bit-field");
      e = char_type_node;
    }
  else if (is_overloaded_fn (e))
    {
      pedwarn ("ISO C++ forbids applying %<sizeof%> to an expression of "
	       "function type");
      e = char_type_node;
    }
  else if (type_unknown_p (e))
    {
      cxx_incomplete_type_error (e, TREE_TYPE (e));
      e = char_type_node;
    }
  else
    e = TREE_TYPE (e);
  return cxx_sizeof_or_alignof_type (e, SIZEOF_EXPR, true);
}
static tree cxx_sizeof_expr ( tree e ) { if ( e == error_mark_node ) return error_mark_node ; if ( processing_template_decl ) { e = build_min ( SIZEOF_EXPR , size_type_node , e ) ; TREE_SIDE_EFFECTS ( e ) = 0 ; TREE_READONLY ( e ) = 1 ; return e ; } if ( TREE_CODE ( e ) == COMPONENT_REF && TREE_CODE ( TREE_OPERAND ( e , 1 ) ) == FIELD_DECL && DECL_C_BIT_FIELD ( TREE_OPERAND ( e , 1 ) ) ) { error ( " " ) ; e = char_type_node ; } else if ( is_overloaded_fn ( e ) ) { pedwarn ( " " " " ) ; e = char_type_node ; } else if ( type_unknown_p ( e ) ) { cxx_incomplete_type_error ( e , TREE_TYPE ( e ) ) ; e = char_type_node ; } else e = TREE_TYPE ( e ) ; return cxx_sizeof_or_alignof_type ( e , SIZEOF_EXPR , true ) ; }
Process a sizeof expression where the operand is an expression.
Process a sizeof expression where the operand is an expression .