vscode-cpptools
vscode-cpptools copied to clipboard
Stepping over std::vector<std::string> v{""} with g++-12 incorrect jumps to the end of the function
Environment
- OS and version: Ubuntu22
- VS Code: latest
- C/C++ extension: latest
- GDB / LLDB version: gdb 12.1 (also repros with 13).
Bug Summary and Steps to Reproduce
- Use C++ code
#include <vector>
#include <string>
int main()
{
std::vector<std::string> v{""};
return 0;
}
- Put a breakpoint on the std::vector line and use F5.
- Choose to compile with the g++-12 compiler -- it doesn't repro if you switch to g++-11.
- Step over the std::vector function.
Bug: The stepping jumps to the bottom of the function instead of going to the next line. This occurs if additional lines of code are added as well. Stepping an extra time goes to the next line (return 0).
Debugger Configurations
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++-12 build active file",
"command": "/usr/bin/g++-12",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
launch.json is the default generated with F5.
Debugger Logs
...
Other Extensions
No response
Additional Information
I didn't find this bug -- it was found by an "internal team".