Discussion:
Set parsing mode to C++14
Maverick Chardet
2016-11-10 08:07:44 UTC
Permalink
Dear all,

I've read several times that KDevelop 5 had complete support for C++14,
which makes sense if using Clang, but I've never found how to set the
parser in C++14 mode. Every time I use a C++14 function of the standard
library it is not found (ex: std::begin, or std::make_unique), even though
it compiles just fine.

I'm using KDevelop 5.0.2 from the Arch repository and I have Clang 3.9.0.
I've tried generating the compile_commands.json file with CMake (the
CMakeLists.txt file contains set(CMAKE_CXX_STANDARD 14)) but it didn't help.

Thank you in advance!

Maverick
René J.V. Bertin
2016-11-10 08:54:29 UTC
Permalink
Post by Maverick Chardet
parser in C++14 mode. Every time I use a C++14 function of the standard
library it is not found (ex: std::begin, or std::make_unique), even though
it compiles just fine.
Are the corresponding headers provided in a dedicated directory, maybe? You could start by figuring out where they live and add their path(s) as additional search paths in the "language support" dialog of the project settings.

The compile_commands.json file is already generated with cmake, so generating it by hand shouldn't be necessary esp. if you don't need to invoke cmake with arguments.

R.
Maverick Chardet
2016-11-10 10:34:06 UTC
Permalink
Oh I was looking for the "language support" dialog of the project settings
and I found the options for the parser here, sorry for not finding it
sooner! Thanks!

Maverick
Post by René J.V. Bertin
Post by Maverick Chardet
parser in C++14 mode. Every time I use a C++14 function of the standard
library it is not found (ex: std::begin, or std::make_unique), even though
it compiles just fine.
Are the corresponding headers provided in a dedicated directory, maybe?
You could start by figuring out where they live and add their path(s) as
additional search paths in the "language support" dialog of the project
settings.
The compile_commands.json file is already generated with cmake, so
generating it by hand shouldn't be necessary esp. if you don't need to
invoke cmake with arguments.
R.
Loading...