PR c++/66957
* search.c (protected_accessible_p): Revert fix for 38579.
From-SVN: r226974
2015-08-17 Jason Merrill <jason@redhat.com>
+ PR c++/66957
+ * search.c (protected_accessible_p): Revert fix for 38579.
+
PR c++/58063
* tree.c (bot_manip): Remap SAVE_EXPR.
Here DERIVED is a possible P, DECL is m and BINFO_TYPE (binfo) is N. */
/* If DERIVED isn't derived from N, then it can't be a P. */
- if (!DERIVED_FROM_P (BINFO_TYPE (binfo), derived))
+ if (!DERIVED_FROM_P (context_for_name_lookup (decl), derived))
return 0;
access = access_in_type (derived, decl);
struct C : public P
{
// C can access P's copy ctor, but can't convert b to const P&.
- C(const B& b) : P(b) {} // { dg-error "inaccessible base" }
+ C(const B& b) : P(b) {} // { dg-error "inaccessible base" "" { xfail *-*-* } }
};
void foo()
--- /dev/null
+// PR c++/66957
+
+class BaseClass {
+protected:
+ static int x;
+};
+
+struct DerivedA : BaseClass { };
+
+struct DerivedB : BaseClass {
+ DerivedB() {
+ (void) DerivedA::x;
+ }
+};