**Describe the bug**
`sync` here is a pointer to a global `sync` function implicitly converted to a bool:

https://github.com/ClickHouse/ClickHouse/blob/624ccd5206a7be7c8a56f2f7590e13d57a074008/src/Databases/DatabaseReplicated.cpp#L797

**How to reproduce**
compile `master` or `v22.8.4.7-lts` with warnings enabled

**Error message and/or stacktrace**


{
    stopReplication();
    ddl_worker = nullptr;
    DatabaseAtomic::shutdown();
}
void DatabaseReplicated::dropTable(ContextPtr local_context, const String & table_name, bool sync)
{
    auto txn = local_context->getZooKeeperMetadataTransaction();
    assert(!ddl_worker->isCurrentlyActive() || txn || startsWith(table_name, ".inner_id."));
    if (txn && txn->isInitialQuery() && !txn->isCreateOrReplaceQuery())
    {
        String metadata_zk_path = zookeeper_path + "/metadata/" + escapeForFileName(table_name);
        txn->addOp(zkutil::makeRemoveRequest(metadata_zk_path, -1));
    }
    auto table = tryGetTable(table_name, getContext());
    if (table->getName() == "MaterializedView" || table->getName() == "WindowView")
    {
        
        table->dropInnerTableIfAny(sync, local_context);
    }
    std::lock_guard lock{metadata_mutex};
    UInt64 new_digest = tables_metadata_digest;
    new_digest -= getMetadataHash(table_name);
    if (txn && !txn->isCreateOrReplaceQuery())
        txn->addOp(zkutil::makeSetRequest(replica_path + "/digest", toString(new_digest), -1));
    DatabaseAtomic::dropTableImpl(local_context, table_name, sync);
    tables_metadata_digest = new_digest;
    assert(checkDigestValid(local_context));
}
void DatabaseReplicated::renameTable(ContextPtr local_context, const String & table_name, IDatabase & to_database,