**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**


{
    try
    {
        if (!getContext()->hasZooKeeper())
        {
            throw Exception("Can't create replicated database without ZooKeeper", ErrorCodes::NO_ZOOKEEPER);
        }
        auto current_zookeeper = getContext()->getZooKeeper();
        if (!current_zookeeper->exists(zookeeper_path))
        {
            
            createDatabaseNodesInZooKeeper(current_zookeeper);
        }
        replica_path = fs::path(zookeeper_path) / "replicas" / getFullReplicaName();
        bool is_create_query = mode == LoadingStrictnessLevel::CREATE;
        String replica_host_id;
        if (current_zookeeper->tryGet(replica_path, replica_host_id))
        {
            if (replica_host_id == DROPPED_MARK && !is_create_query)
            {
                LOG_WARNING(log, "Database {} exists locally, but marked dropped in ZooKeeper ({}). "
                                 "Will not try to start it up", getDatabaseName(), replica_path);
                is_probably_dropped = true;
                return;
            }
            String host_id = getHostID(getContext(), db_uuid);
            if (is_create_query || replica_host_id != host_id)
            {
                throw Exception(
                    ErrorCodes::REPLICA_IS_ALREADY_EXIST,