[cfe-dev] should -Wimplicit-fallthrough require C++11?

Ted Kremenek kremenek at apple.com
Fri Nov 9 20:06:50 PST 2012

On Nov 9, 2012, at 7:04 PM, Richard Smith <richard at metafoo.co.uk> wrote:

>> The motivation is that the attribute used to decorate a fall-through as explicit is only available when using C++11.  This was particularly frustrating for C users.
> I'm not in favor of this change. If people are frustrated that they
> can't annotate fallthrough outside C++11, how about we add a
> __builtin_fallthrough() which generates no code, and has the same
> effect as the [[clang::fallthrough]] attribute?

I like this idea, but that raw syntax to propose to users is hideous.  If we could wrap it in something consistent for both C and C++98/C++11 users, e.g. a macro that expands to the "right thing", that would be more appealing.

> If warning is
> considered valuable enough for these users to enable it in C++11 code,
> presumably it's valuable enough to be worth making usable outside
> C++11 mode.

I agree.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121109/001d17fa/attachment.html>

More information about the cfe-dev mailing list