summaryrefslogtreecommitdiff
path: root/packages/net-im/telegram-desktop/files/gcc-if-constexpr-tmpfix.patch
blob: 7b421e087a2fd732df8a3a161589a09690c04069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Source: https://github.com/reagentoo/gentoo-overlay/blob/1aa11de043487fa4dc6caa8e9655a90ecba70e6c/net-im/telegram-desktop/files/patches/gcc-if-constexpr-tmpfix.patch
Upstream: No
Reason: Fix compiler SIGSEV of GCC 7.x
diff --git a/Telegram/SourceFiles/export/data/export_data_types.cpp b/Telegram/SourceFiles/export/data/export_data_types.cpp
index 0cc79f7e2..b54065ba1 100644
--- a/Telegram/SourceFiles/export/data/export_data_types.cpp
+++ b/Telegram/SourceFiles/export/data/export_data_types.cpp
@@ -179,7 +179,8 @@ Image ParseMaxImage(
 				result.width = data.vw.v;
 				result.height = data.vh.v;
 				result.file.location = ParseLocation(data.vlocation);
-				if constexpr (MTPDphotoCachedSize::Is<decltype(data)>()) {
+				constexpr bool is = MTPDphotoCachedSize::Is<decltype(data)>();
+				if constexpr (is) {
 					result.file.content = data.vbytes.v;
 					result.file.size = result.file.content.size();
 				} else {
diff --git a/Telegram/SourceFiles/export/export_api_wrap.cpp b/Telegram/SourceFiles/export/export_api_wrap.cpp
index 34ddd1b5a..21816472a 100644
--- a/Telegram/SourceFiles/export/export_api_wrap.cpp
+++ b/Telegram/SourceFiles/export/export_api_wrap.cpp
@@ -710,7 +710,8 @@ void ApiWrap::handleUserpicsSlice(const MTPphotos_Photos &result) {
 	Expects(_userpicsProcess != nullptr);
 
 	result.match([&](const auto &data) {
-		if constexpr (MTPDphotos_photos::Is<decltype(data)>()) {
+		constexpr bool is = MTPDphotos_photos::Is<decltype(data)>();
+		if constexpr (is) {
 			_userpicsProcess->lastSlice = true;
 		}
 		loadUserpicsFiles(Data::ParseUserpicsSlice(
@@ -1128,7 +1129,8 @@ void ApiWrap::requestMessagesSlice() {
 		result.match([&](const MTPDmessages_messagesNotModified &data) {
 			error("Unexpected messagesNotModified received.");
 		}, [&](const auto &data) {
-			if constexpr (MTPDmessages_messages::Is<decltype(data)>()) {
+			constexpr bool is = MTPDmessages_messages::Is<decltype(data)>();
+			if constexpr (is) {
 				_chatProcess->lastSlice = true;
 			}
 			loadMessagesFiles(Data::ParseMessagesSlice(