https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110561
--- Comment #4 from Carlos Galvez <carlosgalvezp at gmail dot com> --- To clarify, the .gcov file looks like this (correct) on GCC 7.5.0, which I believe is newer than the duplicated bug mentioned here: -: 0:Source:main.cpp -: 0:Graph:main.gcno -: 0:Data:main.gcda -: 0:Runs:1 -: 0:Programs:1 -: 1:#include <vector> -: 2:#include <string> -: 3: 1: 4:std::string joinPath(std::vector<std::string> const& path_parts) -: 5:{ 1: 6: std::string path{}; 3: 7: for (auto const& path_part : path_parts) -: 8: { 2: 9: if (!path.empty()) -: 10: { 1: 11: path += "/"; -: 12: } -: 13: 2: 14: path += path_part; -: 15: } -: 16: 1: 17: return path; -: 18:} -: 19: 1: 20:int main() -: 21:{ 2: 22: std::vector<std::string> strings = {"foo", "bar"}; 1: 23: joinPath(strings); 1: 24:}