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.
From-SVN: r177846
+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
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
--- /dev/null
+// 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>;