FreeBSD/contrib/gcc/cp/typeck.c
/* Process a sizeof or alignof expression where the operand is a
   type.  */
Process a sizeof or alignof expression where the operand is a
type.
Process a sizeof or alignof expression where the operand is a type .
tree
cxx_sizeof_or_alignof_type (tree type, enum tree_code op, bool complain)
{
  tree value;
  bool dependent_p;
  gcc_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR);
  if (type == error_mark_node)
    return error_mark_node;
  type = non_reference (type);
  if (TREE_CODE (type) == METHOD_TYPE)
    {
      if (complain && (pedantic || warn_pointer_arith))
	pedwarn ("invalid application of %qs to a member function", 
		 operator_name_info[(int) op].name);
      value = size_one_node;
    }
  dependent_p = dependent_type_p (type);
  if (!dependent_p)
    complete_type (type);
  if (dependent_p
      || (processing_template_decl 
	  && COMPLETE_TYPE_P (type)
	  && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST))
    {
      value = build_min (op, size_type_node, type);
      TREE_READONLY (value) = 1;
      return value;
    }
  return c_sizeof_or_alignof_type (complete_type (type),
				   op == SIZEOF_EXPR,
				   complain);
}
tree cxx_sizeof_or_alignof_type ( tree type , enum tree_code op , bool complain ) { tree value ; bool dependent_p ; gcc_assert ( op == SIZEOF_EXPR || op == ALIGNOF_EXPR ) ; if ( type == error_mark_node ) return error_mark_node ; type = non_reference ( type ) ; if ( TREE_CODE ( type ) == METHOD_TYPE ) { if ( complain && ( pedantic || warn_pointer_arith ) ) pedwarn ( " " , operator_name_info [ ( int ) op ] . name ) ; value = size_one_node ; } dependent_p = dependent_type_p ( type ) ; if ( ! dependent_p ) complete_type ( type ) ; if ( dependent_p || ( processing_template_decl && COMPLETE_TYPE_P ( type ) && TREE_CODE ( TYPE_SIZE ( type ) ) != INTEGER_CST ) ) { value = build_min ( op , size_type_node , type ) ; TREE_READONLY ( value ) = 1 ; return value ; } return c_sizeof_or_alignof_type ( complete_type ( type ) , op == SIZEOF_EXPR , complain ) ; }
Process a sizeof or alignof expression where the operand is a
type.
Process a sizeof or alignof expression where the operand is a type .
/* VLA types will have a non-constant size.  In the body of an
	 uninstantiated template, we don't need to try to compute the
	 value, because the sizeof expression is not an integral
	 constant expression in that case.  And, if we do try to
	 compute the value, we'll likely end up with SAVE_EXPRs, which
	 the template substitution machinery does not expect to see.  */