+2018-04-05  Ville Voutilainen  <ville.voutilainen@gmail.com>
+
+       Implement P0969
+       * decl.c (find_decomp_class_base): Check accessibility instead
+       of declared access, adjust diagnostic.
+
 2018-04-05  Ville Voutilainen  <ville.voutilainen@gmail.com>
 
        Implement P0961
 
        inform (DECL_SOURCE_LOCATION (field), "declared here");
        return error_mark_node;
       }
-    else if (TREE_PRIVATE (field) || TREE_PROTECTED (field))
+    else if (!accessible_p (type, field, true))
       {
-       error_at (loc, "cannot decompose non-public member %qD of %qT",
+       error_at (loc, "cannot decompose inaccessible member %qD of %qT",
                  field, type);
        inform (DECL_SOURCE_LOCATION (field),
                TREE_PRIVATE (field)
 
                                        // { dg-warning "structured bindings only available with -std=c..17 or -std=gnu..17" "" { target c++14_down } .-1 }
   auto [ k ] { b };                    // { dg-error "cannot decompose class type 'B' because it has an anonymous union member" }
                                        // { dg-warning "structured bindings only available with -std=c..17 or -std=gnu..17" "" { target c++14_down } .-1 }
-  auto [ l, l2 ] = c;                  // { dg-error "cannot decompose non-public member 'C::b' of 'C'" }
+  auto [ l, l2 ] = c;                  // { dg-error "cannot decompose inaccessible member 'C::b' of 'C'" }
                                        // { dg-warning "structured bindings only available with -std=c..17 or -std=gnu..17" "" { target c++14_down } .-1 }
   auto [ m ] = d;                      // { dg-warning "structured bindings only available with -std=c..17 or -std=gnu..17" "" { target c++14_down } }
-  auto [ n ] { e };                    // { dg-error "cannot decompose non-public member 'E::a' of 'E'" }
+  auto [ n ] { e };                    // { dg-error "cannot decompose inaccessible member 'E::a' of 'E'" }
                                        // { dg-warning "structured bindings only available with -std=c..17 or -std=gnu..17" "" { target c++14_down } .-1 }
   auto [ o ] { f };                    // { dg-warning "structured bindings only available with -std=c..17 or -std=gnu..17" "" { target c++14_down } }
   auto & [ p ] { g };                  // { dg-error "cannot decompose class type 'G': both it and its base class 'F' have non-static data members" }