https://bugs.kde.org/show_bug.cgi?id=453759
Bug ID: 453759 Summary: KSyntaxHighlighting does not build with a C++20 compiler on Windows Product: frameworks-syntax-highlighting Version: 5.93.0 Platform: Microsoft Windows OS: Microsoft Windows Status: REPORTED Severity: critical Priority: NOR Component: framework Assignee: kwrite-bugs-n...@kde.org Reporter: nicolas.arnaudcor...@gmail.com Target Milestone: --- SUMMARY KSyntaxHighlighting does not compile with Visual Studio 2022 and C++20. (You need a C++20 compiler that support the new format standard library feature) STEPS TO REPRODUCE 1. Compile KSyntaxHighlighting with Visual Studio 2022 in C++20 mode... OBSERVED RESULT Thousands of errors like that: ``` C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\chrono(4595): error C2760: syntax error: unexpected token 'identifier', expected 'type specifier' C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\chrono(4622): error C3646: '_Alignment': unknown override specifier C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\chrono(4629): note: see reference to class template instantiation 'std::_Chrono_format_specs<_CharT>' being compiled C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\chrono(4622): error C2059: syntax error: '=' C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\chrono(4622): error C2653: '_Fmt_align': is not a class or namespace name ``` EXPECTED RESULT It builds ;) ADDITIONAL INFORMATION The problem comes from the generation of headers with ecm_generate_headers. One of the header is "Format", which will be mixed up with the standard library one "format". Obviously, this error does not happen on Linux. I see 2 ways to fix it: - complex: change the generated header to something else than Format (may impact other projects) - easy: don't call ecm_generate_headers on Windows, or at least add a way to not do it with a CMake variable Maybe there's another one, I don't know. -- You are receiving this mail because: You are watching all bug changes.