name-lookup.c (current_decl_namespace): Non-static.
* name-lookup.c (current_decl_namespace): Non-static. (pop_nested_namespace): Sanity check. * cp-tree.h: Declare current_decl_namespace. * decl.c (grokvardecl): Use it instead of current_namespace. (grokfndecl): Likewise. * gnu/gcj/runtime/natSharedLibLoader.cc (findCore): Move declaration of _Jv_create_core out of the function. From-SVN: r158074
This commit is contained in:
parent
feb3b88ad7
commit
ae099258d3
|
@ -1,5 +1,11 @@
|
||||||
2010-04-07 Jason Merrill <jason@redhat.com>
|
2010-04-07 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
* name-lookup.c (current_decl_namespace): Non-static.
|
||||||
|
(pop_nested_namespace): Sanity check.
|
||||||
|
* cp-tree.h: Declare current_decl_namespace.
|
||||||
|
* decl.c (grokvardecl): Use it instead of current_namespace.
|
||||||
|
(grokfndecl): Likewise.
|
||||||
|
|
||||||
PR c++/38392
|
PR c++/38392
|
||||||
* pt.c (tsubst_friend_function): Instatiate a friend that has already
|
* pt.c (tsubst_friend_function): Instatiate a friend that has already
|
||||||
been used.
|
been used.
|
||||||
|
|
|
@ -4644,6 +4644,7 @@ extern tree pushdecl_top_level_and_finish (tree, tree);
|
||||||
extern tree check_for_out_of_scope_variable (tree);
|
extern tree check_for_out_of_scope_variable (tree);
|
||||||
extern void print_other_binding_stack (struct cp_binding_level *);
|
extern void print_other_binding_stack (struct cp_binding_level *);
|
||||||
extern tree maybe_push_decl (tree);
|
extern tree maybe_push_decl (tree);
|
||||||
|
extern tree current_decl_namespace (void);
|
||||||
|
|
||||||
/* decl.c */
|
/* decl.c */
|
||||||
extern tree poplevel (int, int, int);
|
extern tree poplevel (int, int, int);
|
||||||
|
|
|
@ -6758,7 +6758,7 @@ grokfndecl (tree ctype,
|
||||||
if (in_namespace)
|
if (in_namespace)
|
||||||
set_decl_namespace (decl, in_namespace, friendp);
|
set_decl_namespace (decl, in_namespace, friendp);
|
||||||
else if (!ctype)
|
else if (!ctype)
|
||||||
DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
|
DECL_CONTEXT (decl) = FROB_CONTEXT (current_decl_namespace ());
|
||||||
|
|
||||||
/* `main' and builtins have implicit 'C' linkage. */
|
/* `main' and builtins have implicit 'C' linkage. */
|
||||||
if ((MAIN_NAME_P (declarator)
|
if ((MAIN_NAME_P (declarator)
|
||||||
|
@ -7020,7 +7020,7 @@ grokvardecl (tree type,
|
||||||
/* An explicit "extern" specifier indicates a namespace-scope
|
/* An explicit "extern" specifier indicates a namespace-scope
|
||||||
variable. */
|
variable. */
|
||||||
if (declspecs->storage_class == sc_extern)
|
if (declspecs->storage_class == sc_extern)
|
||||||
scope = current_namespace;
|
scope = current_decl_namespace ();
|
||||||
else if (!at_function_scope_p ())
|
else if (!at_function_scope_p ())
|
||||||
scope = current_scope ();
|
scope = current_scope ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3170,7 +3170,7 @@ set_decl_namespace (tree decl, tree scope, bool friendp)
|
||||||
|
|
||||||
/* Return the namespace where the current declaration is declared. */
|
/* Return the namespace where the current declaration is declared. */
|
||||||
|
|
||||||
static tree
|
tree
|
||||||
current_decl_namespace (void)
|
current_decl_namespace (void)
|
||||||
{
|
{
|
||||||
tree result;
|
tree result;
|
||||||
|
@ -3342,6 +3342,7 @@ void
|
||||||
pop_nested_namespace (tree ns)
|
pop_nested_namespace (tree ns)
|
||||||
{
|
{
|
||||||
timevar_push (TV_NAME_LOOKUP);
|
timevar_push (TV_NAME_LOOKUP);
|
||||||
|
gcc_assert (current_namespace == ns);
|
||||||
while (ns != global_namespace)
|
while (ns != global_namespace)
|
||||||
{
|
{
|
||||||
pop_namespace ();
|
pop_namespace ();
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
2010-04-07 Jason Merrill <jason@redhat.com>
|
2010-04-07 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
* g++.dg/lookup/ns4.C: New.
|
||||||
|
|
||||||
PR c++/38392
|
PR c++/38392
|
||||||
* g++.dg/template/friend51.C: New test.
|
* g++.dg/template/friend51.C: New test.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
// { dg-do link }
|
||||||
|
|
||||||
|
namespace N {
|
||||||
|
void f();
|
||||||
|
}
|
||||||
|
|
||||||
|
void N::f()
|
||||||
|
{
|
||||||
|
extern int i;
|
||||||
|
extern void g();
|
||||||
|
i = 1;
|
||||||
|
g();
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace N {
|
||||||
|
int i;
|
||||||
|
void g() { }
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() { }
|
|
@ -1,3 +1,8 @@
|
||||||
|
2010-04-07 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
* gnu/gcj/runtime/natSharedLibLoader.cc (findCore): Move
|
||||||
|
declaration of _Jv_create_core out of the function.
|
||||||
|
|
||||||
2010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
2010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
||||||
|
|
||||||
* Makefile.in: Regenerate.
|
* Makefile.in: Regenerate.
|
||||||
|
|
|
@ -119,11 +119,14 @@ gnu::gcj::runtime::SharedLibHelper::hasResource (jstring name)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_DLOPEN
|
||||||
|
extern gnu::gcj::Core *_Jv_create_core (_Jv_core_chain *node, jstring name);
|
||||||
|
#endif
|
||||||
|
|
||||||
gnu::gcj::Core *
|
gnu::gcj::Core *
|
||||||
gnu::gcj::runtime::SharedLibHelper::findCore (jstring name)
|
gnu::gcj::runtime::SharedLibHelper::findCore (jstring name)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_DLOPEN
|
#ifdef HAVE_DLOPEN
|
||||||
extern gnu::gcj::Core *_Jv_create_core (_Jv_core_chain *node, jstring name);
|
|
||||||
ensureInit();
|
ensureInit();
|
||||||
return _Jv_create_core ((_Jv_core_chain *) core_chain, name);
|
return _Jv_create_core ((_Jv_core_chain *) core_chain, name);
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue