With the attached test case, do
% g++ -ftest-coverage -fprofile-arcs covbug.cpp -o covbug
% ./covbug
% gcov covbug.cpp
There will be two lines flagged as uncovered:
% grep '####' covbug.cpp.gcov
#####: 29: m_bits = new unsigned[nw];
#####: 37: return result;
The first is expected, the second is wrong. I repeatedly see
errors of this type, where a return of a class object is flagged as
not covered. Either a "-" (indicating that no code is present) or an
execution count would be acceptable, but putting out ##### indicating
uncovered source code is a bug.
--
Summary: return of class object sometimes reported as uncovered
code
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gcov/profile
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jbuck at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23052