Commit 2ba9c47e by Mark Mitchell Committed by Mark Mitchell

pt.c (tsubst_decl): Set DECL_CONTEXT for namespace-scope variables.

	* pt.c (tsubst_decl): Set DECL_CONTEXT for namespace-scope
	variables.

From-SVN: r43924
parent 9556f887
2001-07-10 Mark Mitchell <mark@codesourcery.com>
* pt.c (tsubst_decl): Set DECL_CONTEXT for namespace-scope
variables.
2001-07-10 Jason Merrill <jason_merrill@redhat.com>
* semantics.c (cp_expand_stmt): Fix for null
......
......@@ -5946,12 +5946,13 @@ tsubst_decl (t, args, type)
ctx = tsubst_aggr_type (DECL_CONTEXT (t), args,
/*complain=*/1,
in_decl, /*entering_scope=*/1);
else if (DECL_NAMESPACE_SCOPE_P (t))
ctx = DECL_CONTEXT (t);
else
{
/* Subsequent calls to pushdecl will fill this in. */
ctx = NULL_TREE;
if (!DECL_NAMESPACE_SCOPE_P (t))
local_p = 1;
local_p = 1;
}
/* Check to see if we already have this specialization. */
......
// Build don't run:
// Origin: Andrey Slepuhin <pooh@msu.ru>
namespace A
{
int j;
template <typename val_t>
struct X
{
inline X ()
{
extern int j;
i = j;
}
int i;
};
}
int main ()
{
A::X<int> x;
}
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