Compiling Clang with -Wimplicit-fallthrough

What's the feeling about compiling Clang with -Wimplicit-fallthrough
turned on by default? I've gone through the code and have found that
most of the sites it flags are either already called out by comments
or are benign--for example, in lib/Edit/RewriteObjCFoundationAPI.cpp:

  case NSAPI::NSNumberWithUnsignedInt:
  case NSAPI::NSNumberWithUnsignedInteger:
    CallIsUnsigned = true;
  case NSAPI::NSNumberWithInt:
  case NSAPI::NSNumberWithInteger:

(The behavior of the check seems to be a little conservative here, but
I can come up with arguments for flagging the fallthrough or not
flagging it; as it stands, the test for the feature explicitly checks
that the diagnostic is generated.)

I suppose that one difficulty might be the lack of a
compiler-independent annotation. Some quick searches show that others
have made various proposals before (__builtin_fallthrough(), etc); has
there been any consensus on this?


I think test/SemaCXX/switch-implicit-fallthrough-macro.cpp may be along the lines of what you are looking for.

– Sean Silva