void-packages/srcpkgs/telegram-desktop/patches/dc1e61d09c9193386a32f70821f...

28 lines
1.1 KiB
Diff

From dc1e61d09c9193386a32f70821ff841819c88379 Mon Sep 17 00:00:00 2001
From: Nicholas Guriev <guriev-ns@ya.ru>
Date: Fri, 31 Aug 2018 00:28:27 +0300
Subject: [PATCH] Workaround internal compiler error in GCC
Fixes: #5111
---
Telegram/SourceFiles/apiwrap.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp
index 3301b6f04..286d2b55c 100644
--- Telegram/SourceFiles/apiwrap.cpp
+++ Telegram/SourceFiles/apiwrap.cpp
@@ -2390,7 +2390,11 @@ void ApiWrap::requestFileReference(
request(std::move(data)).done([=](const auto &result) {
const auto parsed = Data::GetFileReferences(result);
- for (const auto &[origin, reference] : parsed) {
+ for (const auto &p : parsed) {
+ // Unpack here the parsed pair by hand to workaround a GCC bug.
+ // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87122
+ const FileLocationId &origin = p.first;
+ const QByteArray &reference = p.second;
const auto documentId = base::get_if<DocumentFileLocationId>(
&origin);
if (documentId) {