summaryrefslogtreecommitdiff
path: root/packages/net-im/telegram-desktop/files/gcc-if-constexpr-tmpfix.patch
blob: 701a6b3092787c06e6f8c85e79582ddf083794f1 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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 SourceFiles/export/data/export_data_types.cpp SourceFiles/export/data/export_data_types.cpp
index f835dc2f9..188708ab8 100644
--- Telegram/SourceFiles/export/data/export_data_types.cpp
+++ Telegram/SourceFiles/export/data/export_data_types.cpp
@@ -221,7 +221,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 {
@@ -409,7 +410,8 @@ Document ParseDocument(
 			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 {
@@ -1017,7 +1019,8 @@ Message ParseMessage(
 	auto result = Message();
 	data.match([&](const auto &data) {
 		result.id = data.vid.v;
-		if constexpr (!MTPDmessageEmpty::Is<decltype(data)>()) {
+		constexpr bool is = (!MTPDmessageEmpty::Is<decltype(data)>());
+		if constexpr (is) {
 			result.toId = ParsePeerId(data.vto_id);
 			const auto peerId = (!data.is_out()
 				&& data.has_from_id()
diff --git SourceFiles/export/export_api_wrap.cpp SourceFiles/export/export_api_wrap.cpp
index b618937f6..528d61393 100644
--- Telegram/SourceFiles/export/export_api_wrap.cpp
+++ Telegram/SourceFiles/export/export_api_wrap.cpp
@@ -709,7 +709,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(
@@ -1141,7 +1142,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(