title: lcov marking lines with function declarations as reachable but not covered
body: <p>I'm trying to use lcov (v1.13, on OS X, with clang as compiler) to generate code coverage for my test suite and I've hit one annoying problem that I don't know how to solve. There's a few similar questions on SO, but I couldn't find the solution to this one. For some reason, function/member declarations are marked as reachable but not executed, kind of like in the example below (this is inline method definition in a header): </p>
  
  <p><a href="https://i.stack.imgur.com/829ZJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/829ZJ.png" alt="enter image description here"></a></p>
  
  <p>This renders line coverage metrics useless, so I was hoping there's a way to fix it without marking each declaration as LCOV_EXCL_LINE.</p>
  
  <p>Compiler flags used are pretty standard:</p>
  
  <pre><code>-g -O0 -fno-inline -ftest-coverage -fprofile-arcs -fno-elide-constructors
  </code></pre>
  
  <p>What's strange is that method <em>definitions</em> in source files are also marked as red, although the bodies are not, e.g.:</p>
  
  <pre><code>// header.h
  class Foo { 
      void bar();      // ignored, marked as unreachable
  }  
  
  // header.cpp
  void Foo::bar() {    // marked as red (reachable / not executed)
      do_something();  // marked as covered
  }
  </code></pre>
  
  <p>If it's of any importance, the source files are part of a static library that's statically linked to the test harness in CMake.</p>