[PATCH] D36407: [Sema] Extend -Wenum-compare to handle mixed enum comparisons in switch statements

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 8 11:03:49 PDT 2017


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

Aside from a minor naming nit, LGTM!



================
Comment at: lib/Sema/SemaStmt.cpp:605-608
+static QualType GetTypeBeforeIntegralPromotion(const Expr *&expr) {
+  if (const auto *cleanups = dyn_cast<ExprWithCleanups>(expr))
     expr = cleanups->getSubExpr();
+  while (const auto *impcast = dyn_cast<ImplicitCastExpr>(expr)) {
----------------
Since you're touching the code -- can you change the names to `E` (or some other, more descriptive name), `Cleanups` and `Impcast` to meet the coding standards?


https://reviews.llvm.org/D36407





More information about the cfe-commits mailing list