FreeBSD/contrib/gcc/cp/typeck.c
/* Apply the TYPE_QUALS to the new DECL.  */
Apply the TYPE_QUALS to the new DECL.
Apply the TYPE_QUALS to the new DECL .
void
cp_apply_type_quals_to_decl (int type_quals, tree decl)
{
  tree type = TREE_TYPE (decl);
  if (type == error_mark_node)
    return;
  if (TREE_CODE (type) == FUNCTION_TYPE
      && type_quals != TYPE_UNQUALIFIED)
    {
      if (pedantic)
	{
	  tree bad_type = build_qualified_type (type, type_quals);
	  pedwarn ("ignoring %qV qualifiers added to function type %qT",
		   bad_type, type);
	}
      TREE_TYPE (decl) = TYPE_MAIN_VARIANT (type);
      return;
    }
  if (
      TYPE_NEEDS_CONSTRUCTING (type)
      || !COMPLETE_TYPE_P (type)
      || TYPE_HAS_MUTABLE_P (type))
    type_quals &= ~TYPE_QUAL_CONST;
  c_apply_type_quals_to_decl (type_quals, decl);
}
void cp_apply_type_quals_to_decl ( int type_quals , tree decl ) { tree type = TREE_TYPE ( decl ) ; if ( type == error_mark_node ) return ; if ( TREE_CODE ( type ) == FUNCTION_TYPE && type_quals != TYPE_UNQUALIFIED ) { if ( pedantic ) { tree bad_type = build_qualified_type ( type , type_quals ) ; pedwarn ( " " , bad_type , type ) ; } TREE_TYPE ( decl ) = TYPE_MAIN_VARIANT ( type ) ; return ; } if ( TYPE_NEEDS_CONSTRUCTING ( type ) || ! COMPLETE_TYPE_P ( type ) || TYPE_HAS_MUTABLE_P ( type ) ) type_quals &= ~ TYPE_QUAL_CONST ; c_apply_type_quals_to_decl ( type_quals , decl ) ; }
Apply the TYPE_QUALS to the new DECL.
Apply the TYPE_QUALS to the new DECL .
/* This was an error in C++98 (cv-qualifiers cannot be added to
	 a function type), but DR 295 makes the code well-formed by
	 dropping the extra qualifiers. */ /* Avoid setting TREE_READONLY incorrectly.  */ /* If the object has a constructor, the constructor may modify
	 the object.  */ /* If the type isn't complete, we don't know yet if it will need
	 constructing.  */ /* If the type has a mutable component, that component might be
	 modified.  */