mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-10 04:36:43 +08:00
* decl.c (pushdecl): Don't check for linkage on a non-decl.
From-SVN: r38290
This commit is contained in:
parent
1e185c02d4
commit
fab09a2494
@ -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
|
||||
|
@ -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;
|
||||
|
10
gcc/testsuite/g++.old-deja/g++.other/local4.C
Normal file
10
gcc/testsuite/g++.old-deja/g++.other/local4.C
Normal 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 ();
|
||||
}
|
Loading…
Reference in New Issue
Block a user