Enforce access

static bool enforce_access(tree basetype_path, tree decl, tree diag_decl, tsubst_flags_t complain, access_failure_info *afi = NULL)

''If the current scope isn't allowed to access DECL along BASETYPE_PATH, give an error, or if we're parsing a function or class template, defer the access check to be performed at instantiation time. The most derived class in BASETYPE_PATH is the one used to qualify DECL. DIAG_DECL is the declaration to use in the error diagnostic.''

Checks that basetype_path (which is a BINFO) can access decl. Don't know what it means by 'current scope'; clearly something I'm not understanding.

Defined in semantics.c.