Commit b15c9441 authored by dodji's avatar dodji
Browse files

PR c++/45625 - Template parm name doesn't hide outer class scope's member name

gcc/cp/

	* pt.c (parameter_of_template_p): Handle comparison with DECLs of
	template parameters as created by process_template_parm.

gcc/testsuite/

	* g++.dg/lookup/hidden-var1.C: New test case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177846 138bc75d-0d04-0410-961f-82ee72b054a4
No related merge requests found
2011-08-18 Dodji Seketeli <dodji@redhat.com>
PR c++/45625
* pt.c (parameter_of_template_p): Handle comparison with DECLs of
template parameters as created by process_template_parm.
2011-08-16 Jason Merrill <jason@redhat.com>
PR c++/50086
......
......@@ -7890,8 +7890,13 @@ parameter_of_template_p (tree parm, tree templ)
parms = INNERMOST_TEMPLATE_PARMS (parms);
 
for (i = 0; i < TREE_VEC_LENGTH (parms); ++i)
if (parm == TREE_VALUE (TREE_VEC_ELT (parms, i)))
return true;
{
tree p = TREE_VALUE (TREE_VEC_ELT (parms, i));
if (parm == p
|| (DECL_INITIAL (parm)
&& DECL_INITIAL (parm) == DECL_INITIAL (p)))
return true;
}
 
return false;
}
......
2011-08-18 Dodji Seketeli <dodji@redhat.com>
PR c++/45625
* g++.dg/lookup/hidden-var1.C: New test case.
2011-08-17 Tobias Burnus <burnus@net-b.de>
PR fortran/31461
......
// Origin PR c++/45625
// { dg-do compile }
struct Outer
{
static const int value = 1 ;
template< int value >
struct Inner
{
static const int*
get_value()
{
return &value ;// { dg-error "lvalue required" }
}
};
};
template class Outer::Inner<2>;
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