If I compile the code with g++ 4.7.3
with
g++ test.cpp --std=c++0x
It compiles correctly and if I try to print v1[2];
, I get the correct result.
std::cout << v1[2]; // 56
The Eclipse code analyzer tool (CODAN) may just not be right in this situation.
Rely on the output of a C++ (in this case C++11 compatible) compiler.