MSVC C2280 error with ranged for and deleted copy ctor

Stephan Bergmann sbergman at redhat.com
Tue Dec 10 07:25:34 UTC 2019


On 09/12/2019 17:48, Luboš Luňák wrote:
>   The relevant code is [2]. "GrFragmentProcessor::PaintCRange" is a ctor call
> for a range type [3], which has "return CIter(fT);" as its begin(). And CIter
> indeed has a deleted copy ctor, but AFAICT it shouldn't be needed, C++17's
> guaranteed copy ellision should take care of it.

Advertisement vs. support of guaranteed copy elision is known broken 
with MSVC, see 
<https://gerrit.libreoffice.org/plugins/gitiles/core/+/62bfe29f9045127d479c42376f599ddfb0fbb2ca%5E!/> 
"Already set MSVC's -std:c++17 during the configure.ac feature check".

>   And it builds with GCC/Clang, and it builds even with MSVC here locally. So
> to me it looks like a MSVC bug that's been fixed. How much of a problem would
> it be to bump the minimal required MSVC version (not that I know which one it
> would be exactly)?

We detect HAVE_CPP_GUARANTEED_COPY_ELISION (cf. commit mentioned above) 
for at least the (most recent anyway, I think) VS 2019 version 16.3.10, 
_MSC_VER == 1923 that I have locally.



More information about the LibreOffice mailing list