summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/warn-duplicate-enum.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bot failure from r343042.Erik Pilkington2018-09-251-2/+2
| | | | llvm-svn: 343050
* [Sema] Use a more civilized hash map to implement -Wduplicate-enum.Erik Pilkington2018-09-251-1/+9
| | | | | | | | | DenseMap<long, SOMETHING> used LONG_MAX as a tombstone, so it asserts when you try to insert it! rdar://44774672 llvm-svn: 343042
* Fix some handling of AST nodes with diagnostics.Richard Trieu2018-03-281-10/+10
| | | | | | | | | The diagnostic system for Clang can already handle many AST nodes. Instead of converting them to strings first, just hand the AST node directly to the diagnostic system and let it handle the output. Minor changes in some diagnostic output. llvm-svn: 328688
* Sema: Don't crash when trying to emit a warning for a duplicate value in an ↵Benjamin Kramer2013-04-071-0/+9
| | | | | | | | | invalid enum. Fixes PR15693. A null check on a pointer returned from cast<> is a very dubious construct, do we have a checker for this somewhere? llvm-svn: 178975
* Add back -Wduplicate-enum which I mistakenly removed.Ted Kremenek2012-12-221-0/+92
| | | | | | | | | | | | This was removed with -Wunique-enum, which is still removed. The corresponding thread on cfe-comments for that warning is here: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-September/024224.html If we get specific user feedback for -Wduplicate-enum we can evaluate whether or not to keep it. llvm-svn: 170974
* Per discussion on cfe-dev, remove -Wunique-enums entirely. ThereTed Kremenek2012-09-181-92/+0
| | | | | | | | is no compelling argument that this is a generally useful warning, and imposes a strong stylistic argument on code beyond what it was intended to find warnings in. llvm-svn: 164083
* Add -Wduplicate-enum warning. Clang will emit this warning when an implicitlyRichard Trieu2012-08-301-0/+92
initiated enum constant has the same value as another enum constant. For instance: enum test { A, B, C = -1, D, E = 1 }; Clang will warn that: A and D both have value 0 B and E both have value 1 A few exceptions are made to keep the noise down. Enum constants which are initialized to another enum constant, or an enum constant plus or minus 1 will not trigger this warning. Also, anonymous enums are not checked. llvm-svn: 162938
OpenPOWER on IntegriCloud