[PATCH] D71576: [c++20] Add deprecation warnings for the expression forms deprecated by P1120R0.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 16 15:30:15 PST 2019


rsmith created this revision.
rsmith added reviewers: aaron.ballman, rnk.
Herald added a project: clang.

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).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71576

Files:
  clang/include/clang/AST/Type.h
  clang/include/clang/Basic/DiagnosticGroups.td
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/include/clang/Sema/Sema.h
  clang/lib/AST/Type.cpp
  clang/lib/Sema/SemaChecking.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/SemaExprCXX.cpp
  clang/test/CXX/expr/expr.arith.conv/p2.cpp
  clang/test/Sema/switch.c
  clang/test/Sema/warn-conditional-emum-types-mismatch.c
  clang/test/SemaCXX/deprecated.cpp
  clang/test/SemaCXX/self-comparison.cpp
  clang/test/SemaCXX/warn-enum-compare.cpp
  clang/www/cxx_status.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71576.234176.patch
Type: text/x-patch
Size: 72005 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191216/af2cac79/attachment-0001.bin>


More information about the cfe-commits mailing list