* c-tree.h (lookup_name_two): Likewise.
* c-common.c (handle_cleanup_attribute): Use lookup_name_two instead.
* config/darwin-c.c (darwin_pragma_unused): Likewise.
cp:
* name-lookup.c (lookup_name_two): Add.
* name-lookup.h: Likewise.
testsuite:
* g++.old-deja/g++.mike/unused.C: Add.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107062
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-11-15 Mike Stump <mrs@apple.com>
+
+ * c-decl.c (lookup_name_two): Add.
+ * c-tree.h (lookup_name_two): Likewise.
+ * c-common.c (handle_cleanup_attribute): Use lookup_name_two instead.
+ * config/darwin-c.c (darwin_pragma_unused): Likewise.
+
2005-11-16 Alan Modra <amodra@bigpond.net.au>
PR rtl-optimization/23392
*no_add_attrs = true;
return NULL_TREE;
}
- cleanup_decl = lookup_name (cleanup_id);
+ cleanup_decl = lookup_name_two (cleanup_id, 0);
if (!cleanup_decl || TREE_CODE (cleanup_decl) != FUNCTION_DECL)
{
error ("cleanup argument not a function");
return 0;
}
+/* Similar to `lookup_name' for the benefit of common code and the C++
+ front end. */
+
+tree
+lookup_name_two (tree name, int ARG_UNUSED (prefer_type))
+{
+ return lookup_name (name);
+}
+
/* Similar to `lookup_name' but look only at the indicated scope. */
static tree
extern tree implicitly_declare (tree);
extern void keep_next_level (void);
extern tree lookup_name (tree);
+extern tree lookup_name_two (tree, int);
extern void pending_xref_error (void);
extern void c_push_function_context (struct function *);
extern void c_pop_function_context (struct function *);
tok = c_lex (&decl);
if (tok == CPP_NAME && decl)
{
- tree local = lookup_name (decl);
+ tree local = lookup_name_two (decl, 0);
if (local && (TREE_CODE (local) == PARM_DECL
|| TREE_CODE (local) == VAR_DECL))
TREE_USED (local) = 1;
+2005-11-15 Mike Stump <mrs@apple.com>
+
+ * name-lookup.c (lookup_name_two): Add.
+ * name-lookup.h: Likewise.
+
2005-11-15 Mark Mitchell <mark@codesourcery.com>
PR c++/24667
0, LOOKUP_COMPLAIN);
}
+/* Similar to `lookup_name' for the benefit of common code. */
+
+tree
+lookup_name_two (tree name, int prefer_type)
+{
+ return lookup_name (name, prefer_type);
+}
+
/* Look up NAME for type used in elaborated name specifier in
the scopes given by SCOPE. SCOPE can be either TS_CURRENT or
TS_WITHIN_ENCLOSING_NON_CLASS. Although not implied by the
extern void poplevel_class (void);
extern tree pushdecl_with_scope (tree, cxx_scope *, bool);
extern tree lookup_name (tree, int);
+extern tree lookup_name_two (tree, int);
extern tree lookup_name_real (tree, int, int, bool, int, int);
extern tree lookup_type_scope (tree, tag_scope);
extern tree namespace_binding (tree, tree);
+2005-11-11 Mike Stump <mrs@apple.com>
+
+ * g++.old-deja/g++.mike/unused.C: Add.
+
2005-11-15 Mark Mitchell <mark@codesourcery.com>
PR c++/24667
--- /dev/null
+// { dg-do compile { target *-*-darwin* } }
+// { dg-options { -Wunused-parameter } }
+// Radar 4125055
+
+void foo(int x) {
+#pragma unused ( x )
+}