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


auto zookeeper = getContext()->getZooKeeper();
    auto escaped_table_names = zookeeper->getChildren(zookeeper_path + "/metadata");
    for (const auto & escaped_table_name : escaped_table_names)
    {
        String table_name = unescapeForFileName(escaped_table_name);
        if (!filter(table_name))
            continue;
        String zk_metadata;
        if (!zookeeper->tryGet(zookeeper_path + "/metadata/" + escaped_table_name, zk_metadata))
            throw Exception(ErrorCodes::INCONSISTENT_METADATA_FOR_BACKUP, "Metadata for table {} was not found in ZooKeeper", table_name);
        ParserCreateQuery parser;
        auto create_table_query = parseQuery(parser, zk_metadata, 0, getContext()->getSettingsRef().max_parser_depth);
        auto & create = create_table_query->as<ASTCreateQuery &>();
        create.attach = false;
        create.setTable(table_name);
        create.setDatabase(getDatabaseName());
        StoragePtr storage;
        if (create.uuid != UUIDHelpers::Nil)
        {
            storage = DatabaseCatalog::instance().tryGetByUUID(create.uuid).second;
            if (storage)
                storage->adjustCreateQueryForBackup(create_table_query);
        }
        res.emplace_back(create_table_query, storage);
    }
    return res;
}
void DatabaseReplicated::createTableRestoredFromBackup(
    const ASTPtr & create_table_query,
    ContextMutablePtr local_context,