Scanner Version: sonar-scanner-4.7.0.2747
Server Verison: Enterprise Edition Version 9.7.1 (build 62043)
When we scan a code with C++ code calling back() function on an empty vector. SonarQube doesn’t detect any error/issue
Here is what the code look like:
01 int function_a(int inHeight)
02 {
03 std::vector<ITransformFactory_ptr> transFactories;
04 if (SetupArriRawDecoder == 12)
05 {
06 transFactories.emplace_back(mDecoderTransformFactory);
07 }
08
09 test_bool(transformFactories.back());
10 }
There should be an issue identify at line 09
Please let me know if this is an issue that should be detected by SonarQube
Thanks