summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-enum-compare.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [c++20] Add deprecation warnings for the expression forms deprecated by P1120R0.Richard Smith2019-12-161-168/+168
| | | | | | | | | | | | | | | | | | | This covers: * usual arithmetic conversions (comparisons, arithmetic, conditionals) between different enumeration types * usual arithmetic conversions between enums and floating-point types * comparisons between two operands of array type The deprecation warnings are on-by-default (in C++20 compilations); it seems likely that these forms will become ill-formed in C++23, so warning on them now by default seems wise. For the first two bullets, off-by-default warnings were also added for all the cases where we didn't already have warnings (covering language modes prior to C++20). These warnings are in subgroups of the existing -Wenum-conversion (except that the first case is not warned on if either enumeration type is anonymous, consistent with our existing -Wenum-conversion warnings).
* Fix warn-enum-compare.cpp on WindowsHans Wennborg2017-12-111-1/+6
| | | | | | It's been failing since r319875. llvm-svn: 320405
* Catch more cases with -Wenum-compareRichard Trieu2017-09-091-0/+43
| | | | | | | Treat typedef enum as named enums instead of anonymous enums. Anonymous enums are ignored by the warning, so previously, typedef enums were ignored as well. llvm-svn: 312842
* [Sema] Assign new flag -Wenum-compare-switch to switch-related parts of ↵Gabor Horvath2017-08-091-3/+3
| | | | | | | | | | -Wenum-compare Patch by: Reka Nikolett Kovacs Differential Revision: https://reviews.llvm.org/D36526 llvm-svn: 310521
* [Sema] -Wenum-compare no longer warn on anonymous enums in switch statementsGabor Horvath2017-08-091-0/+7
| | | | | | Patch by: Reka Nikolett Kovacs llvm-svn: 310468
* [Sema] Extend -Wenum-compare to handle mixed enum comparisons in switch ↵Gabor Horvath2017-08-091-0/+17
| | | | | | | | | | statements Patch by: Reka Nikolett Kovacs Differential Revision: https://reviews.llvm.org/D36407 llvm-svn: 310449
* Enhance -Wtautological-constant-out-of-range-compare to include the name of ↵Ted Kremenek2013-03-151-2/+2
| | | | | | | | the enum constant. This is QoI. Fixes <rdar://problem/13076064>. llvm-svn: 177190
* Improvements to my patch in r164143 perFariborz Jahanian2012-09-201-2/+2
| | | | | | Richard's comments. // rdar://12202422 llvm-svn: 164316
* c: warn when an integer value comparison with anFariborz Jahanian2012-09-181-2/+2
| | | | | | | | integral expression have the obvious result. Patch reviewed by John McCall off line. // rdar://12202422 llvm-svn: 164143
* Implement -Wenum-compare, which warns when comparing two enums ofChandler Carruth2011-02-171-0/+212
different types. We omit the warning when the enum types are anonymous. Unlike GCC, this warning does not distinguish between C++ and C/ObjC for controling whether it is on by default, it is always on by default. Original patch contributed by Richard Trieu (@ Google), I fixed some style issues, and cleaned it up for submission. llvm-svn: 125739
OpenPOWER on IntegriCloud