PR c++/23842
* pt.c (tsubst_default_argument): Do treat default argument
expressions as occurring in the context of the function called.
PR c++/23842
* g++.dg/template/access16.C: New test.
From-SVN: r104224
+2005-09-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23842
+ * pt.c (tsubst_default_argument): Do treat default argument
+ expressions as occurring in the context of the function called.
+
2005-09-12 Mark Mitchell <mark@codesourcery.com>
PR c++/23841
we must be careful to do name lookup in the scope of S<T>,
rather than in the current class. */
push_access_scope (fn);
- /* The default argument expression should not be considered to be
- within the scope of FN. Since push_access_scope sets
- current_function_decl, we must explicitly clear it here. */
- current_function_decl = NULL_TREE;
/* The "this" pointer is not valid in a default argument. */
if (cfun)
{
+2005-09-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/23842
+ * g++.dg/template/access16.C: New test.
+
2005-09-13 Richard Sandiford <richard@codesourcery.com>
* gfortran.dg/char_pack_2.f90: Increase the vector size.
--- /dev/null
+// PR c++/23842
+
+struct S;
+extern S *p;
+template <class T> int f(T*, int y = ((T*)p)->x) {
+ return y;
+}
+struct S {
+private:
+ int x;
+ template <class U> friend int f(U*, int);
+};
+int g() {
+ return f(p);
+}
+