Force all and extra warnings as errors except for tests

This commit is contained in:
Bartek Kryza
2022-06-08 20:32:32 +02:00
parent fbcecdab50
commit 0e7c30541a
20 changed files with 45 additions and 51 deletions

View File

@@ -450,8 +450,6 @@ void generator::generate(const package &p, std::ostream &ostr) const
void generator::generate_relationships(
const package &p, std::ostream &ostr) const
{
const auto &uns = m_config.using_namespace();
for (const auto &subpackage : p) {
if (dynamic_cast<package *>(subpackage.get())) {
// TODO: add option - generate_empty_packages

View File

@@ -174,7 +174,7 @@ int class_::calculate_template_specialization_match(
}
// Iterate over all template arguments
for (int i = 0; i < other.templates().size(); i++) {
for (auto i = 0U; i < other.templates().size(); i++) {
const auto &template_arg = templates().at(i);
const auto &other_template_arg = other.templates().at(i);

View File

@@ -901,10 +901,10 @@ void translation_unit_visitor::process_field(
!template_instantiation_added_as_aggregation &&
(tr.kind() != cppast::cpp_type_kind::builtin_t) &&
(tr.kind() != cppast::cpp_type_kind::template_parameter_t)) {
const auto &ttt = resolve_alias(mv.type());
found_relationships_t relationships;
auto found = find_relationships(ttt, relationships);
const auto &unaliased_type = resolve_alias(mv.type());
find_relationships(unaliased_type, relationships);
for (const auto &[type, relationship_type] : relationships) {
if (relationship_type != relationship_t::kNone) {
@@ -1350,9 +1350,9 @@ void translation_unit_visitor::process_friend(const cppast::cpp_friend &f,
{
// Only process friends to other classes or class templates
if (!f.entity() ||
(f.entity().value().kind() != cppast::cpp_entity_kind::class_t) &&
((f.entity().value().kind() != cppast::cpp_entity_kind::class_t) &&
(f.entity().value().kind() !=
cppast::cpp_entity_kind::class_template_t))
cppast::cpp_entity_kind::class_template_t)))
return;
relationship r{relationship_t::kFriendship, "",
@@ -1384,11 +1384,11 @@ void translation_unit_visitor::process_friend(const cppast::cpp_friend &f,
f.entity().value());
const auto &class_ = ft.class_();
auto scope = cppast::cpp_scope_name(type_safe::ref(ft));
if (ft.class_().user_data() == nullptr) {
if (class_.user_data() == nullptr) {
spdlog::warn(
"Empty user data in friend class template: {}, {}, {}",
ft.name(),
fmt::ptr(reinterpret_cast<const void *>(&ft.class_())),
fmt::ptr(reinterpret_cast<const void *>(&class_)),
scope.name());
return;
}
@@ -1940,8 +1940,6 @@ void translation_unit_visitor::
const auto &function_argument =
static_cast<const cppast::cpp_function_type &>(targ_type);
const auto &rt = function_argument.return_type();
// Search for relationships in argument return type
// TODO...