Issue 164431
Summary llvm-cov shows a dead closing bracket in a switch as uncovered code
Labels coverage
Assignees
Reporter chfast
    The example file:

```cpp
enum class E {A, B};

void test(E e)
{
 switch (e)
    {
        case E::A:
        {
            break;
 }
        default:
        {
            break;
        }
 }
}

int main()
{
    test(E::A);
    test(E::B);
    return 0;
}
```

The brackets after the `break;` statements are reported as uncovered code:

```
    1|       |enum class E {A, B};
    2|       |
 3|       |void test(E e)
    4|      2|{
    5|      2|    switch (e)
 6|      2|    {
    7|      1|        case E::A:
    8|      1|        {
 9|      1|            break;
   10|      0|        }
   11|      1| default:
   12|      1|        {
   13|      1|            break;
   14| 0|        }
   15|      2|    }
   16|      2|}
   17|       |
 18|       |int main()
   19|      1|{
   20|      1|    test(E::A);
   21| 1|    test(E::B);
   22|      1|    return 0;
   23|      1|}
``` 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to