https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116838
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jamaika from comment #2)
> I don't know who's to blame.
If you enable C++20 (or C++23) and GCC tells you that your code is not
compatible with C++20, fix the code.
(In reply to Jamaika from comment #0)
> Codec vvenc
> ```
> In file included from MCTF.cpp:52:
> ../Utilities/NoMallocThreadPool.h: In lambda function:
> ../Utilities/NoMallocThreadPool.h:160:31: warning: implicit capture of
> 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
> 160 | nonconst->m_cond.wait( l, [=] { return
> !m_intBarrier.isBlocked(); } );
> | ^
> ../Utilities/NoMallocThreadPool.h:160:31: note: add explicit 'this' or
> '*this' capture
> ```
This is a language change in C++20. If you want to compile the code as C++20 or
C++23, then the code needs to be fixed. This is not a GCC bug.
> codec fdk-aac
> ```
> ps_encode.cpp: In function 'FDK_PSENC_ERROR
> FDKsbrEnc_PSEncode(HANDLE_PS_ENCODE, HANDLE_PS_OUT, UCHAR*, UINT, FIXP_DBL*
> (*)[2][2], INT, INT)':
> ps_encode.cpp:1002:34: warning: arithmetic between different enumeration
> types 'PS_CONSTS' and 'PS_BANDS' is deprecated
> [-Wdeprecated-enum-enum-conversion]
> 1002 | PS_MAX_ENVELOPES * PS_MAX_BANDS * sizeof(PS_DELTA));
> ```
Another C++ language change. The code needs to be fixed.
> codec davs2
> ```
> decoder.cc: In function 'void decoder_signal(davs2_t*, davs2_frame_t*, int)':
> decoder.cc:268:12: warning: '++' expression of 'volatile'-qualified type is
> deprecated [-Wvolatile]
> 268 | frame->i_decoded_line++;
> | ~~~~~~~^~~~~~~~~~~~~~
> ```
Another language change. The code needs to be fixed.
> vapoursynth
> ```
> avisynth_compat.cpp:1309:56: error: no match for 'operator+' (operand types
> are 'const char [16]' and 'std::u8string' {aka
> 'std::__cxx11::basic_string<char8_t>'})
> 1309 | vsapi->mapSetError(out, ("Failed to load " +
> fsPath.u8string() + ". GetLastError() returned " + std::to_string(lastError)
> + ". The file you tried to load or one of its dependencies is probably
> missing.").c_str());
> | ~~~~~~~~~~~~~~~~~ ^
> ~~~~~~~~~~~~~~~~~
> | |
> |
> | const char [16]
> std::u8string {aka std::__cxx11::basic_string<char8_t>}
> ```
In C++17 std::u8string was a typedef for std::string, but in C++20 it's a
different type, std::basic_string<char8_t>. You cannot append char to a string
of char8_t.
The code needs to be fixed. The simplest fix is to just change
fsPath.u8string() to fsPath.string().