Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » CODAN false positive with push_back
CODAN false positive with push_back [message #1063693] Thu, 13 June 2013 14:33 Go to next message
Eclipse UserFriend
Here is a simple code snippet that triggers a semantic error by codan, while the code still compiles fine (got to turn c++11 on).

#include <vector>

int test() {

    std::vector<int> v1 = {12, 34};
    std::vector<int> v2 = {56, 78};

    //push_back is underlined red.
    v1.push_back(v2[0]);

    return v1[2];

}


The semantic error is: Invalid arguments ' Candidates are: void push_back(const int &) void push_back(int &&) '.

Any way to fix it, or at least make the error disappear from the problem list?
Re: CODAN false positive with push_back [message #1064559 is a reply to message #1063693] Wed, 19 June 2013 17:33 Go to previous message
Eclipse UserFriend
I am having a similar problem with:
std::vector<int> *testVector = new std::vector<int>();
testVector->at(0);

The code compiles fine, but eclipse (CODAN?) is complaining:
Invalid arguments '
Candidates are:
int & at(?)
const int & at(?)
'


There propably is something wrong in my settings, as I had to tweak them a bit to get c++11 to compile at all and to remove 90% of the errors it showed.
Previous Topic:android/java/src/pcf: No such file or directory
Next Topic:Can Eclipse ignore CMakeLists.txt
Goto Forum:
  


Current Time: Tue Jul 15 15:13:04 EDT 2025

Powered by FUDForum. Page generated in 0.03813 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top