Clion IDE and inspector finds errors not flagged by compiler

I have some code which compiles with no errors on OSX 10.10.4 using clang++:

vector<string> test_clion2(const string &b) {
    vector<string> names;


    return names;

When I run the code inspector (prior to a Git commit), it complains with a type check error for the emplace_back() call:

"Parameter type mismatch: Binding 'const string' to non-const reference (at line xxx)"

Also the IDE pops up a tooltip with a similar message.  I'm not a language lawyer, but I believe the code is correct, and it does apparently run correctly.

Is this a bug, or am I missing something?

Comment actions Permalink


CLion doesn't fully support variadic templates yet but we are planning to add it in the future versions. We have the related issue in the tracker: . Feel free to comment or upvote.

Comment actions Permalink

Excellent, thanks.


Please sign in to leave a comment.