Le 02/04/2024 à 14:12, Kornel Benko a écrit :
The first one looks like a matter of old gcc that does not like the {}
constructor (don't remember the name).

JMarc

If so, can something be done here?

This compiles fine here, can you check that it does for you too?

Also, I do not know how to test this code. Riki can you confirm that it makes sense?

JMarc



From 62d212a2f0c7ff851f03aa4c4fd5c9d138f9b4a1 Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Wed, 3 Apr 2024 14:49:13 +0200
Subject: [PATCH] Construct tuple explicitly for older compilers

gcc < 6 refuses to use {foo, bar, baz} to construct a tuple in this context.
---
 src/frontends/qt/GuiRef.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/frontends/qt/GuiRef.cpp b/src/frontends/qt/GuiRef.cpp
index 6a2446a5a6..f400aae8eb 100644
--- a/src/frontends/qt/GuiRef.cpp
+++ b/src/frontends/qt/GuiRef.cpp
@@ -455,7 +455,8 @@ void GuiRef::redoRefs()
 	for (auto const & theref : refs_) {
 		// first: plain label name, second: gui name, third: pretty name
 		QString const lab = toqstr(get<0>(theref));
-		refsNames.append({lab, toqstr(get<1>(theref)), toqstr(get<2>(theref))});
+		// {a, b, c} is nicer, but gcc < 6 barks on it
+		refsNames.append(make_tuple(lab, toqstr(get<1>(theref)), toqstr(get<2>(theref))));
 		if (groupCB->isChecked()) {
 			if (lab.contains(":")) {
 				QString const pref = lab.split(':')[0];
-- 
2.25.1

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to