Bug 30257 - static initializers are attributed to bogus line number in coverage.
Summary: static initializers are attributed to bogus line number in coverage.
Status: RESOLVED DUPLICATE of bug 15369
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-19 06:00 UTC by Seongbae Park
Modified: 2017-08-17 21:40 UTC (History)
1 user (show)

See Also:
Host: i686-unknown-linux-gnu
Target: i686-unknown-linux-gnu
Build: i686-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Seongbae Park 2006-12-19 06:00:57 UTC
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.
Comment 1 Andrew Pinski 2006-12-19 06:50:23 UTC
I have seen this bug before somewhere like maybe PR 15369.
Comment 2 Seongbae Park 2006-12-19 06:58:22 UTC
Yes, it looks like duplicate, although PR 15369 is against 3.4.
Comment 3 Eric Gallager 2017-08-17 21:40:59 UTC
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 ***