nested templates should be skipped while flattening (template nodes themselves, not expanded versions)
also non-public nested classes should be ignored