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.
I have seen this bug before somewhere like maybe PR 15369.
Yes, it looks like duplicate, although PR 15369 is against 3.4.
Redoing https://gcc.gnu.org/ml/gcc-bugs/2017-08/msg01613.html Eric Gallager <egallager at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |egallager at gcc dot gnu.org Resolution|--- |DUPLICATE --- Comment #3 from Eric Gallager <egallager at gcc dot gnu.org> --- (In reply to Seongbae Park from comment #2) > Yes, it looks like duplicate, although PR 15369 is against 3.4. Still duplicate-ish enough. Closing. *** This bug has been marked as a duplicate of bug 15369 *** *** This bug has been marked as a duplicate of bug 15369 ***