<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 27.05.2012, at 13:55, Matthieu Monrocq wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div class="gmail_quote">On Sun, May 27, 2012 at 12:30 AM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; "><div><div><br></div><div>P.S. It would also be interesting to know what people think about converting fall-through annotations in comments to a checked annotation so we could use this diagnostic on regular basis?</div><div>We could wrap [[clang::fallthrough]] to a macro, so the code would continue to work in c++98 mode, but in c++11 mode it would also allow to run this diagnostic (btw, is llvm compilable in c++11 mode?). Sample implementation of macro:</div>

<div><pre><b>#ifdef __clang__
#if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
#define FALLTHROUGH [[clang::fallthrough]]
#endif
#endif

#ifndef FALLTHROUGH
#define FALLTHROUGH do { } while (0)
#endif</b></pre></div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br>
<div>Best regards,</div><div>Alexander Kornienko</div></font></span></div>
<br></blockquote><div> </div><div>One question: in the proposed macro, why not put the the `;` in the macro since it will be mandatory anyway ?<br></div></div></blockquote></div><br><div>I know several text editors whose simple indentation algorithm gets confused by lines not ending in semicolons. I prefer them outside the macro.</div><div><br></div><div>Sebastian</div></body></html>