https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82633

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |ASSIGNED
   Last reconfirmed|                            |2017-10-21
         Resolution|WONTFIX                     |---
   Target Milestone|---                         |8.0
            Summary|gcov does not handle        |Document GCOV and function
                   |removed functions           |removal
                   |                            |(-fkeep-inline-functions,
                   |                            |-fkeep-static-functions)
     Ever confirmed|0                           |1

--- Comment #9 from Martin Liška <marxin at gcc dot gnu.org> ---
Thanks Andrew, works for me:

$ g++ -fkeep-inline-functions -fkeep-static-functions --coverage removed.cpp

        -:    1:class MyClass2
        -:    2:{
        -:    3:  public:
    #####:    4:    void iterate() { a = 5; }
        -:    5:
        -:    6:    int a;
        -:    7:};
        -:    8:
    #####:    9:static int foo(int a)
        -:   10:{
    #####:   11:  return ++a;
        -:   12:}
        -:   13:
    #####:   14:int bar(int a)
        -:   15:{
    #####:   16:  return a + 2;
        -:   17:}
        -:   18:
        1:   19:int main()
        -:   20:{
        -:   21:  MyClass2 a;
        1:   22:  return 0;
        -:   23:}

Let me document that, maybe useful for GCOV users.

Reply via email to