aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-08-24 17:31:54 -0400
committerJason Merrill <jason@gcc.gnu.org>2009-08-24 17:31:54 -0400
commit3146f36f935b0594a4719320e891e2d7524c014c (patch)
tree21f3fafc0a9586551eed28be49bc928210769cec /gcc/cp/decl.c
parentc767899ef26cac6092786591518ff9e5a54dbe04 (diff)
downloadgcc-3146f36f935b0594a4719320e891e2d7524c014c.zip
gcc-3146f36f935b0594a4719320e891e2d7524c014c.tar.gz
gcc-3146f36f935b0594a4719320e891e2d7524c014c.tar.bz2
re PR c++/41109 (Argument flagged as unused despite use in sizeof())
PR c++/41109 PR c++/41110 PR c++/41134 * cp-tree.h (DECL_ODR_USED): New macro. (struct lang_decl_base): Add odr_used flag. * decl.c (duplicate_decls): Propagate it. Use it for error. * pt.c (register_specialization): Use it for error. * decl2.c (mark_used): Use it as gating flag rather than TREE_USED. (cp_write_global_declarations): Use it for error. (tree_used_ok): Remove. * cp-tree.h: Remove tree_used_ok. * call.c (build_call_a): Don't call it. * init.c (build_offset_ref): Likewise. From-SVN: r151061
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 0746b82..cad0fc5 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1890,6 +1890,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
}
DECL_TEMPLATE_INSTANTIATED (newdecl)
|= DECL_TEMPLATE_INSTANTIATED (olddecl);
+ DECL_ODR_USED (newdecl) |= DECL_ODR_USED (olddecl);
/* If the OLDDECL is an instantiation and/or specialization,
then the NEWDECL must be too. But, it may not yet be marked
@@ -1955,7 +1956,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
should have exited above, returning 0. */
gcc_assert (DECL_TEMPLATE_SPECIALIZATION (newdecl));
- if (TREE_USED (olddecl))
+ if (DECL_ODR_USED (olddecl))
/* From [temp.expl.spec]:
If a template, a member template or the member of a class