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


maybe_path += '/';
                args_ref[0]->as<ASTLiteral>()->value = maybe_path + "auto_{shard}";
                args_ref[1]->as<ASTLiteral>()->value = maybe_replica + "auto_{replica}";
                return;
            }
            throw Exception(ErrorCodes::INCORRECT_QUERY,
                            "Explicit zookeeper_path and replica_name are specified in ReplicatedMergeTree arguments. "
                            "If you really want to specify it explicitly, then you should use some macros "
                            "to distinguish different shards and replicas");
        }
    }
    if (const auto * query_alter = query->as<ASTAlterQuery>())
    {
        for (const auto & command : query_alter->command_list->children)
        {
            if (!isSupportedAlterType(command->as<ASTAlterCommand&>().type))
                throw Exception("Unsupported type of ALTER query", ErrorCodes::NOT_IMPLEMENTED);
        }
    }
    if (auto * query_drop = query->as<ASTDropQuery>())
    {
        if (query_drop->kind == ASTDropQuery::Kind::Detach && query_context->getSettingsRef().database_replicated_always_detach_permanently)
            query_drop->permanently = true;
        if (query_drop->kind == ASTDropQuery::Kind::Detach && !query_drop->permanently)
            throw Exception(ErrorCodes::INCORRECT_QUERY, "DETACH TABLE is not allowed for Replicated databases. "
                                                         "Use DETACH TABLE PERMANENTLY or SYSTEM RESTART REPLICA or set "
                                                         "database_replicated_always_detach_permanently to 1");
    }
}
BlockIO DatabaseReplicated::tryEnqueueReplicatedDDL(const ASTPtr & query, ContextPtr query_context, bool internal)