[PATCH] D53950: Enable -Wimplicit-fallthrough for clang as well as GCC

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 31 15:42:28 PDT 2018


rnk added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp:190
     }
-  // FALLTHROUGH
+    LLVM_FALLTHROUGH;  // FALLTHROUGH
   case clang::CK_IntegralCast:
----------------
bogner wrote:
> Having both LLVM_FALLTHROUGH and the comment is redundant.
It is, but I made an effort to preserve comments like this everywhere, since I thought it might go down easier for more folks. It's not hard to remove them, of course.


================
Comment at: clang/lib/AST/ExprConstant.cpp:11146
     }
-
-    // OffsetOf falls through here.
-    LLVM_FALLTHROUGH;
+    llvm_unreachable("invalid unary operator class");
   }
----------------
bogner wrote:
> Could you commit this case (and the one below) separately? While most of the changes in this patch are mechanical, this one is arguably a correctness fix.
Sure, there's this and a couple others, like the AArch64ISelLowering one.


https://reviews.llvm.org/D53950





More information about the llvm-commits mailing list