summaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2013-03-29 16:09:35 +0000
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2013-03-29 16:09:35 +0000
commit80a58eb0a89adf7bf6d4f2d1811ba8996c4fe2f4 (patch)
treeeffb9d381a62e67766863cbbe83fd7aac2b98280 /gcc/cp/class.c
parent51bad4971e69b642dfcc10d78c915eafc54fe689 (diff)
downloadgcc-80a58eb0a89adf7bf6d4f2d1811ba8996c4fe2f4.tar.gz
* tree.h (VAR_P): New.
cp/ * call.c (build_java_interface_fn_ref): Likewise. (make_temporary_var_for_ref_to_temp): Likewise. * class.c (check_field_decls): Likewise. (layout_class_type): Likewise. (finish_struct_1): Likewise. (fixed_type_or_null): Likewise. (get_vtbl_decl_for_binfo): Likewise. * cp-gimplify.c (omp_var_to_track): Likewise. (cp_genericize_r): Likewise. * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise. * cp-tree.h (LANG_DECL_HAS_MIN): Likewise. (DECL_DISCRIMINATOR_P): Likewise. * decl.c (poplevel): Likewise. (decls_match): Likewise. (duplicate_decls): Likewise. (decl_jump_unsafe): Likewise. (start_decl): Likewise. (check_for_uninitialized_const_var): Likewise. (make_rtl_for_nonlocal_decl): Likewise. (cp_finish_decl): Likewise. (expand_static_init): Likewise. (local_variable_p): Likewise. (maybe_register_incomplete_var): Likewise. * decl2.c (grokfield): Likewise. (comdat_linkage): Likewise. (determine_visibility): Likewise. (import_export_decl): Likewise. (prune_vars_needing_no_initialization): Likewise. (decl_maybe_constant_var_p): Likewise. * error.c (dump_simple_decl): Likewise. (dump_template_decl): Likewise. (cp_printer): Likewise. * except.c (build_throw): Likewise. * init.c (build_vtbl_address): Likewise. (member_init_ok_or_else): Likewise. (build_aggr_init): Likewise. (expand_aggr_init_1): Likewise. (build_offset_ref): Likewise. (constant_value_1): Likewise. * mangle.c (write_mangled_name): Likewise. (write_prefix): Likewise. * name-lookup.c (supplement_binding_1): Likewise. (add_decl_to_level): Likewise. (pushdecl_maybe_friend_1): Likewise. (check_for_out_of_scope_variable): Likewise. (validate_nonmember_using_decl): Likewise. (lookup_name_innermost_nonclass_level_1): Likewise. (lookup_arg_dependent_1): Likewise. * parser.c (cp_parser_lambda_introducer): Likewise. (cp_parser_template_argument): Likewise. (cp_parser_single_declaration): Likewise. * pt.c (convert_nontype_argument): Likewise. (instantiate_class_template_1): Likewise. (tsubst_decl): Likewise. (tsubst_expr): Likewise. (do_decl_instantiation): Likewise. (do_type_instantiation): Likewise. (regenerate_decl_from_template): Likewise. (always_instantiate_p): Likewise. (instantiate_decl): Likewise. (type_dependent_expression_p): Likewise. (build_non_dependent_expr): Likewise. * repo.c (repo_emit_p): Likewise. * rtti.c (build_dynamic_cast_1): Likewise. * search.c (shared_member_p): Likewise. * semantics.c (outer_var_p): Likewise. (finish_id_expression): Likewise. (finish_omp_clauses): Likewise. (finish_decltype_type): Likewise. (ensure_literal_type_for_constexpr_object): Likewise. * tree.c (lvalue_kind): Likewise. (bot_replace): Likewise. (cp_tree_equal): Likewise. (handle_init_priority_attribute): Likewise. (decl_storage_duration): Likewise. * typeck.c (cxx_sizeof_expr): Likewise. (cxx_alignof_expr): Likewise. (decay_conversion): Likewise. (build_class_member_access_expr): Likewise. (cp_build_array_ref): Likewise. (cxx_mark_addressable): Likewise. (maybe_warn_about_returning_address_of_local): Likewise. (check_return_expr): Likewise. * typeck2.c (cxx_readonly_error): Likewise. (abstract_virtuals_error_sfinae): Likewise. (cxx_incomplete_type_diagnostic): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197240 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 956d5aa9e27..e9f8bbac3a5 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -3327,7 +3327,7 @@ check_field_decls (tree t, tree *access_decls,
If a union contains a static data member, or a member of
reference type, the program is ill-formed. */
- if (TREE_CODE (x) == VAR_DECL)
+ if (VAR_P (x))
{
error ("%q+D may not be static because it is a member of a union", x);
continue;
@@ -3359,7 +3359,7 @@ check_field_decls (tree t, tree *access_decls,
if (type == error_mark_node)
continue;
- if (TREE_CODE (x) == CONST_DECL || TREE_CODE (x) == VAR_DECL)
+ if (TREE_CODE (x) == CONST_DECL || VAR_P (x))
continue;
/* Now it can only be a FIELD_DECL. */
@@ -5826,7 +5826,7 @@ layout_class_type (tree t, tree *virtuals_p)
At this point, finish_record_layout will be called, but
S1 is still incomplete.) */
- if (TREE_CODE (field) == VAR_DECL)
+ if (VAR_P (field))
{
maybe_register_incomplete_var (field);
/* The visibility of static data members is determined
@@ -6327,7 +6327,7 @@ finish_struct_1 (tree t)
/* Complete the rtl for any static member objects of the type we're
working on. */
for (x = TYPE_FIELDS (t); x; x = DECL_CHAIN (x))
- if (TREE_CODE (x) == VAR_DECL && TREE_STATIC (x)
+ if (VAR_P (x) && TREE_STATIC (x)
&& TREE_TYPE (x) != error_mark_node
&& same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (x)), t))
DECL_MODE (x) = TYPE_MODE (t);
@@ -6700,7 +6700,7 @@ fixed_type_or_null (tree instance, int *nonnull, int *cdtorp)
/* Enter the INSTANCE in a table to prevent recursion; a
variable's initializer may refer to the variable
itself. */
- if (TREE_CODE (instance) == VAR_DECL
+ if (VAR_P (instance)
&& DECL_INITIAL (instance)
&& !type_dependent_expression_p_push (DECL_INITIAL (instance))
&& !fixed_type_or_null_ref_ht.find (instance))
@@ -7766,7 +7766,7 @@ get_vtbl_decl_for_binfo (tree binfo)
decl = TREE_OPERAND (TREE_OPERAND (decl, 0), 0);
}
if (decl)
- gcc_assert (TREE_CODE (decl) == VAR_DECL);
+ gcc_assert (VAR_P (decl));
return decl;
}