From 401e1166f9de4c4a19aba79f9afcd611eaa6e30d Mon Sep 17 00:00:00 2001 From: Nicholas Guriev Date: Fri, 31 Aug 2018 00:28:27 +0300 Subject: [PATCH] Workaround internal compiler error in GCC Closes: #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..c3e3c6f16 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/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 auto &origin = p.first; + const auto &reference = p.second; const auto documentId = base::get_if( &origin); if (documentId) {