Actually, given the response on Dwarf-Discuss, I believe we should
limit this only to DW_TAG_member and DW_TAG_subprogram (to match the spec;
DW_TAG_inheritance handled in the other routine), as for say types and other
children of DW_TAG_class_type no DECL_PRIVATE doesn't mean we need to emit
DW_AT_accessibility DW_ACCESS_public, but instead just that accessibility
is not meaningful for it.
DWARF2 default for DW_TAG_inheritance if DW_AT_accessibility is missing is
private, yes (and the other hunk which handles DW_TAG_inheritance implements
that).
DWARF2 doesn't seem to talk at all about default for DW_TAG_member or
DW_TAG_subprogram, so the patch above just kept status quo in that case for
DWARF2 and only changed to what DWARF3 says for dwarf_version > 2.
Other options are emit DW_AT_accessibility always for
DW_TAG_member/DW_TAG_subprogram for dwarf_version == 2, or pretend the
DWARF3+ rules (private in DW_TAG_class_type, public otherwise) apply even
for DWARF2. Not sure what is best.