* decl.c (pushdecl): Don't check for linkage on a non-decl.

From-SVN: r38290
This commit is contained in:
Jason Merrill 2000-12-15 11:15:52 -05:00 committed by Jason Merrill
parent 1e185c02d4
commit fab09a2494
3 changed files with 15 additions and 2 deletions

View File

@ -1,5 +1,7 @@
2000-12-15 Jason Merrill <jason@redhat.com>
* decl.c (pushdecl): Don't check for linkage on a non-decl.
* call.c (build_op_delete_call): See through ARRAY_TYPEs.
* call.c (build_new_function_call): Lose space before paren in

View File

@ -3821,8 +3821,9 @@ pushdecl (x)
/* Or in the innermost namespace. */
if (! t)
t = namespace_binding (name, DECL_CONTEXT (x));
/* Does it have linkage? */
if (t && ! (TREE_STATIC (t) || DECL_EXTERNAL (t)))
/* Does it have linkage? Note that if this isn't a DECL, it's an
OVERLOAD, which is OK. */
if (t && DECL_P (t) && ! (TREE_STATIC (t) || DECL_EXTERNAL (t)))
t = NULL_TREE;
if (t)
different_binding_level = 1;

View File

@ -0,0 +1,10 @@
// Test that a local declaration of one of a global overload set works
int f () { return 0; }
int f (int);
int main ()
{
int f ();
return f ();
}