Commit ae099258 by Jason Merrill Committed by Jason Merrill

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
parent feb3b88a
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
* pt.c (tsubst_friend_function): Instatiate a friend that has already
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 void print_other_binding_stack (struct cp_binding_level *);
extern tree maybe_push_decl (tree);
extern tree current_decl_namespace (void);
/* decl.c */
extern tree poplevel (int, int, int);
......
......@@ -6758,7 +6758,7 @@ grokfndecl (tree ctype,
if (in_namespace)
set_decl_namespace (decl, in_namespace, friendp);
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. */
if ((MAIN_NAME_P (declarator)
......@@ -7020,7 +7020,7 @@ grokvardecl (tree type,
/* An explicit "extern" specifier indicates a namespace-scope
variable. */
if (declspecs->storage_class == sc_extern)
scope = current_namespace;
scope = current_decl_namespace ();
else if (!at_function_scope_p ())
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. */
static tree
tree
current_decl_namespace (void)
{
tree result;
......@@ -3342,6 +3342,7 @@ void
pop_nested_namespace (tree ns)
{
timevar_push (TV_NAME_LOOKUP);
gcc_assert (current_namespace == ns);
while (ns != global_namespace)
{
pop_namespace ();
......
2010-04-07 Jason Merrill <jason@redhat.com>
* g++.dg/lookup/ns4.C: New.
PR c++/38392
* g++.dg/template/friend51.C: New test.
......
// { 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() { }
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>
* Makefile.in: Regenerate.
......
......@@ -119,11 +119,14 @@ gnu::gcj::runtime::SharedLibHelper::hasResource (jstring name)
#endif
}
#ifdef HAVE_DLOPEN
extern gnu::gcj::Core *_Jv_create_core (_Jv_core_chain *node, jstring name);
#endif
gnu::gcj::Core *
gnu::gcj::runtime::SharedLibHelper::findCore (jstring name)
{
#ifdef HAVE_DLOPEN
extern gnu::gcj::Core *_Jv_create_core (_Jv_core_chain *node, jstring name);
ensureInit();
return _Jv_create_core ((_Jv_core_chain *) core_chain, name);
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment