<div class="gmail_quote">On Sat, Apr 21, 2012 at 5:10 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div class="im">On Sat, Apr 21, 2012 at 4:54 PM, Joe Groff <span dir="ltr"><<a href="mailto:arcata@gmail.com" target="_blank">arcata@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

On Mon, Apr 16, 2012 at 8:17 AM, Alexander Kornienko <<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>> wrote:<br>
> This patch adds diagnostic of unintentional control flow fall-through<br>
> between switch labels. It also provides a way to specifically mark a switch<br>
> label with a c++ 11 attribute [[fallthrough]] to specify an intentional<br>
> fall-through. This also serves as an example of C++ 11 statement attributes,<br>
> and builds upon my recent patch, which introduces support for this language<br>
> feature.<br>
<br>
For future-proofing's sake, does the standard provide any guidance for<br>
naming nonstandardized attributes? Should the attribute be named<br>
something like 'clang::fallthrough' instead of just 'fallthrough', in<br>
case a future standard or other implementations provide for a similar<br>
attribute with different behavior?</blockquote><div><br></div></div><div>Yes, I think so. The attribute namespace mechanism was designed to allow such vendor extensions without creating problems for future standardization. </div>
</div></blockquote><div><br></div><div>I would find this extremely unfortunate. The fallthrough check doesn't seem likely at all to be a vendor-specific extension. I can't imagine any possible standardized meaning for the attribute other than the use being proposed here. Forcing users to type 'clang::' in each place seems to reduce the clarity and readability of the construct with no real benefit. Is this really necessary? Can we not add a top-level attribute when it makes sense?</div>
</div>