GCC Code Coverage Report


Directory: .
File: main.cpp
Date: 2025-09-27 21:24:05+00:00
Coverage Exec Excl Total
Lines: 100.0% 16 0 16
Functions: 100.0% 5 0 5
Branches: 50.0% 3 0 6

Line Branch Exec Source
1 #include <iostream>
2
3 class Bar
4 {
5 public:
6 2 Bar() : m_bar(1)
7 2 {}
8 2 virtual ~Bar()
9
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
2 {} // possible compiler-generated destruction code - auto-detected and excluded
10
11 1 void foo() const
12 {
13 1 std::cout << "Const " << this->m_bar << std::endl;
14 1 }
15 1 void foo()
16 {
17 1 std::cout << "Non const " << this->m_bar << std::endl;
18 1 }
19
20 private:
21 int m_bar;
22 };
23
24 1 int main(int argc, char* argv[]) {
25 2 Bar bar;
26 2 const Bar const_bar;
27
1/2
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
1 bar.foo();
28
1/2
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
1 const_bar.foo();
29
30 1 return 0;
31 }
32