aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-08-16 13:42:56 -0400
committerJason Merrill <jason@gcc.gnu.org>2009-08-16 13:42:56 -0400
commit15305a736f7cb40174ae276912806eaf077de783 (patch)
tree9014dfecbe0670edc4ce4c440e01edcb80786afd /gcc/cp/cp-tree.h
parentd3ece023f3547db2d77a2d96ce0b8294815edcb3 (diff)
downloadgcc-15305a736f7cb40174ae276912806eaf077de783.zip
gcc-15305a736f7cb40174ae276912806eaf077de783.tar.gz
gcc-15305a736f7cb40174ae276912806eaf077de783.tar.bz2
Make TREE_USED match the [basic.def.odr] concept for FUNCTION_DECL and VAR_DECL...
Make TREE_USED match the [basic.def.odr] concept for FUNCTION_DECL and VAR_DECL, so mark_used only has effect the first time. * decl2.c (mark_used): Just return if TREE_USED is already set. Don't set TREE_USED if cp_unevaluated_operand is set. (tree_used_ok): New fn. * init.c (build_offset_ref): Check it instead of TREE_USED. * call.c (build_call_a): Likewise. * cp-tree.h: Declare it. (DECL_NO_LINKAGE_CHECKED): No longer needed. (struct lang_decl_base): Remove no_linkage_checked bitfield. From-SVN: r150807
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index ae39110..bbd1a42 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1579,9 +1579,8 @@ struct GTY(()) lang_decl_base {
unsigned anticipated_p : 1; /* fn or type */
unsigned friend_attr : 1; /* fn or type */
unsigned template_conv_p : 1; /* template only? */
- unsigned no_linkage_checked : 1; /* var or fn */
unsigned u2sel : 1;
- /* 1 spare bit */
+ /* 2 spare bits */
};
/* True for DECL codes which have template info and access. */
@@ -1983,14 +1982,6 @@ struct GTY(()) lang_decl {
(DECL_LANG_SPECIFIC (VAR_OR_FUNCTION_DECL_CHECK (DECL)) \
->u.base.initialized_in_class)
-/* Nonzero if we've checked whether DECL uses types without linkage in a
- potentially invalid way.
- ??? Instead, should fix mark_used to only set TREE_USED when we're
- really using something, and just return if it's already set. */
-#define DECL_NO_LINKAGE_CHECKED(DECL) \
- (DECL_LANG_SPECIFIC (VAR_OR_FUNCTION_DECL_CHECK (DECL)) \
- ->u.base.no_linkage_checked)
-
/* Nonzero for DECL means that this decl is just a friend declaration,
and should not be added to the list of members for this class. */
#define DECL_FRIEND_P(NODE) (DECL_LANG_SPECIFIC (NODE)->u.base.friend_attr)
@@ -4486,6 +4477,7 @@ extern tree build_cleanup (tree);
extern tree build_offset_ref_call_from_tree (tree, VEC(tree,gc) **);
extern void check_default_args (tree);
extern void mark_used (tree);
+extern bool tree_used_ok (tree);
extern void finish_static_data_member_decl (tree, tree, bool, tree, int);
extern tree cp_build_parm_decl (tree, tree);
extern tree get_guard (tree);
@@ -4638,6 +4630,7 @@ extern void mark_decl_instantiated (tree, int);
extern int more_specialized_fn (tree, tree, int);
extern void do_decl_instantiation (tree, tree);
extern void do_type_instantiation (tree, tree, tsubst_flags_t);
+extern bool always_instantiate_p (tree);
extern tree instantiate_decl (tree, int, bool);
extern int comp_template_parms (const_tree, const_tree);
extern bool uses_parameter_packs (tree);