Patches to improve compatibility with modern C++ standard

Kornel Benko kornel at lyx.org
Tue May 5 11:02:07 UTC 2020


Am Tue, 5 May 2020 12:43:33 +0200
schrieb Jean-Marc Lasgouttes <lasgouttes at lyx.org>:

> Le 05/05/2020 à 12:36, Yu Jin a écrit :
> > Still same errors, unary_function was removed in the newer c++ 
> > standards, and the patch sets language standard to latest (Vorschau – 
> > Features aus dem aktuellen C++-Arbeitsentwurf (/std:c++latest)) for me, 
> > where it's just "standard" whithout it. I attached the message line at 
> > the end of CMakeLists, it says  "MSVC_VERSION =  prior to the tests.".  
> 
> Kornel, what is the purpose of your patch? I see things like /std:c++20 
> in there.

Only in first patch though.

> I thought the purpose was to enforce preferably C++14 and then C++11 if 
> not available. That's what is done in autotools in any case.
> 
> Until we use some C++17/20 feature, I do not see the point to ask the 
> compiler to use them. Of course, it is important to get away 
> progressively from obsolete features use as we already do, but this is a 
> different issue.
> 
> JMarc
> 

The purpose of the second patch was to find best match. The check starts at the highest
number and stops at the first successful compilation.

As Thibaut needs /std:c++20, we have to check if it is valid flag.
There exist also /std:c++17 and /std:c++14. So I wanted to check for these values too
if unsuccessful with /std:c++20.
Probably the test finds /std:c++17 for Eugene (which seems to be also /std:c++latest).

What we could do, is check for MSVC_VERSION > 1925 prior to the test.

I do not understand, why compilation using /std:c++latest (which looks recommended) fails
and is successful otherwise.

	Kornel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200505/07f905cf/attachment.asc>


More information about the lyx-devel mailing list