Bug 422219 - Including <ranges> with active C++2a parser crashes kdevelop
Summary: Including <ranges> with active C++2a parser crashes kdevelop
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: 5.5.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-29 10:38 UTC by jan
Modified: 2023-11-07 11:35 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jan 2020-05-29 10:38:21 UTC
SUMMARY
A file that includes ranges crashes kdevelop when the C++ profile is set to c++2a.


STEPS TO REPRODUCE
1. Create a C++ project
2. Create a C++ file that contain the line #include <ranges>
3. Set the C++ Profile to c++2a (also happens when CMakeLists.txt contains set(CMAKE_CXX_STANDARD 20) )

OBSERVED RESULT
Kdevelop starts to reparse the project and crashes at about 87%.

EXPECTED RESULT
Kdevelop reparses the project and treats it as C++20.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.70.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION

I'm using gcc 10.1.0 and clang 10.0.0. The last message that is printed to the terminal is:

kdevelop.plugins.definesandincludes: error while fetching includes for the compiler: "clang" "clang version 10.0.0 \nTarget: x86_64-pc-linux-gnu\nThread model: posix\nInstalledDir: /usr/bin\nFound candidate GCC installation: /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/10.1.0\nFound candidate GCC installation: /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/8.4.0\nFound candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/10.1.0\nFound candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.4.0\nFound candidate GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0\nFound candidate GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/8.4.0\nFound candidate GCC installation: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.1.0\nFound candidate GCC installation: /usr/lib64/gcc/x86_64-pc-linux-gnu/8.4.0\nSelected GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/10.1.0\nCandidate multilib: .;@m64\nCandidate multilib: 32;@m32\nSelected multilib: .;@m64\n (in-process)\n \"/usr/bin/clang-10\" -cc1 -triple x86_64-pc-linux-gnu -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -pic-is-pie -mthread-model posix -mframe-pointer=all -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -v -resource-dir /usr/lib/clang/10.0.0 -I/opt/intel/compilers_and_libraries_2020.0.166/linux/ipp/include -ISUBSTITUTE_INSTALL_DIR_HERE/include -ISUBSTITUTE_INSTALL_DIR_HERE/stdlib -I/opt/intel/compilers_and_libraries_2020.0.166/linux/tbb/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/clang/10.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=gnu++2a -fdebug-compilation-dir /tmp/testcpp20/build -ferror-limit 19 -fmessage-length 0 -stack-protector 2 -fgnuc-version=4.2.1 -fobjc-runtime=gcc -fdiagnostics-show-option -faddrsig -o - -x c -\nerror: invalid argument '-std=gnu++2a' not allowed with 'C'\n"
kdevelop.plugins.definesandincludes: error while fetching defines for the compiler: "clang" ("-xc", "-std=gnu++2a", "-dM", "-E", "-") "error: invalid argument '-std=gnu++2a' not allowed with 'C'\n"
Comment 1 jan 2020-09-09 10:02:38 UTC
The problem still exists in KDevelop 5.6.0.
Comment 2 jan 2023-11-07 11:35:10 UTC
The problem no longer occurs with KDevelop 5.12.230802 (23.08.2). Marking report as resolved and fixed.