how to set clang in Linux and dubegger works with templates?

Hi, I want to know how to set clang in linux?
Simply add in CMAKE_CXX_COMPILER /usr/bin/clang? And save it?

Furthermore, it is possible that the debug not work with templates?
I noticed that sometimes does not perform the "step into".
Have you any suggestions?
Thanks!

4 comments
Comment actions Permalink

Hi Alberto.

As for the Clang compiler: to set it up you need to put path to clang into CMAKE_C_COMPILER/CMAKE_CXX_COMPILER variables. This can be done either in CMakeLists.txt, or by providing command line options in CLion's CMake settings.

0
Comment actions Permalink

As for debugging templates:
Could you please send us a short example to reproduce the case? (you can post it here or send to us via support mail clion-support@jetbrains.com) On our side we've tried the following sample and it worked for us:

template<typename T> T foo(T a, T b) {
    T res = a + b;
    return res;
}

int main() {
    foo<int>(1, 2);
    foo<double>(3, 4);
    return 0;
}
0
Comment actions Permalink

Hi, I solved. I use the linux distrubution Manjaro and I solved the problem of debugging by setting gdb of my system manually. ( Settings->Build...->ToolChains->Use specified: /usr/bin/gdb )
While clang through the first suggestion.
Thanks for your software really well done. I hope that soon is implemented support to valgrind.

0
Comment actions Permalink

Hi Alberto.

We already have an issue about valgrind in our tracker:
https://youtrack.jetbrains.com/issue/CPP-548
Feel free to comment or upvote. Follow to get the updates.

0

Please sign in to leave a comment.