Open pesitec opened 6 years ago
clang-analyzer-deadcode is implemented in Clang Static Analyzer. Clang-tidy only invoke it.
assigned to @devincoughlin
I think the issue can be closed. Clang-tidy only issues a warning if the default branch cannot be taken. A modified example where the enumeration has a third value does not produce a warning because clang-tidy sees that the default branch can be taken. The same happens when the switch uses an integer instead of an enumeration.
Extended Description
In the attached code, clang-tidy 6.0.0 reports "Value stored to 'i1' is never read", but both i1 and i2 in fact are read.