For a given input: 1 class A { 2 int a; 3 public: 4 A(int i) { a = i * i; } 5 6 virtual void func(void); 7 }; 8 9 const A a1(1); 10 11 void func(void) 12 { 13 }
When compiled with -fprofile-arcs -ftest-coverage, the gcno file contains a function _Z41__static_initialization_and_destruction_0ii with some of the line number attributed to t.cc:13. Since the static initializer has nothing to do with the function "func()", it shouldn't get that line number. -- Summary: static initializers are attributed to bogus line number in coverage. Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: seongbae dot park at gmail dot com GCC build triplet: i686-unknown-linux-gnu GCC host triplet: i686-unknown-linux-gnu GCC target triplet: i686-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30257