What is the branch in the destructor reported by gcov?

前端 未结 3 1364
温柔的废话
温柔的废话 2020-12-01 01:30

When I use gcov to measure test coverage of C++ code it reports branches in destructors.

struct Foo
{
    virtual ~Foo()
    {
    }
};

int main (int argc,         


        
3条回答
  •  借酒劲吻你
    2020-12-01 01:58

    Destructor problem still there for gcc version 5.4.0, but seems not to exist for Clang.

    Tested with:

    clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
    Target: x86_64-pc-linux-gnu
    Thread model: posix
    InstalledDir: /usr/bin
    

    Then use "llvm-cov gcov ..." to generate coverage as described here.

提交回复
热议问题