clang should warn if 'else if' clause is same as any previous 'if' clause #9565
Labels
bugzilla
Issues migrated from bugzilla
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
duplicate
Resolved as duplicate
quality-of-implementation
Extended Description
Consider the following C snippit:
I've made a typo in the 'else if' and accidentally tested condition.
It would be nice it clang could warn when it sees this.
With raw ints it's easy to see the mistake, but when they are constants, and two constants accidentally have the same value, it's harder to find.
It would be happy with this in either the compiler or static analyzer.
The text was updated successfully, but these errors were encountered: