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;
names.emplace_back(b);
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?
请先登录再写评论。
Hi!
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: https://youtrack.jetbrains.com/issue/CPP-3615 . Feel free to comment or upvote.
Excellent, thanks.