/* Figure out where the reference is occurring. Check to see if
DECL is private or protected in this scope, since that will
determine whether protected access is allowed. */
- if (current_class_type)
+ tree ct = current_nonlambda_class_type ();
+ if (ct)
protected_ok = protected_accessible_p (decl,
- current_class_type, binfo);
+ ct,
+ binfo);
/* Now, loop through the classes of which we are a friend. */
if (!protected_ok)