<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Apr 21, 2014 at 2:04 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Sat, Apr 19, 2014 at 7:05 PM, Alp Toker <<a href="mailto:alp@nuanti.com">alp@nuanti.com</a>> wrote:<br>

> Small update for the list..<br>
><br>
> We discussed this at LLVM Europe 2014 and came to the conclusion that we<br>
> might as well offer the feature behind an -f flag.<br>
><br>
> This should satisfy user requests for C++11-style attributes in C11 without<br>
> prejudicing any standards process.<br>
<br>
</div>Why just C11? If we're using a feature flag, wouldn't it make sense to<br>
expose this for C++98, or C99, or ObjC (presuming there are no<br>
ambiguities)?</blockquote><div><br></div><div>Yes, if we have this, it should work in all language modes unless there's some fundamental incompatibility.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">
> Thanks to the many detailed use-cases<br>
> people sent in that have made me more comfortable picking this up again.<br>
><br>
> So, I've got a slightly improved version of the patch and will aim to rebase<br>
> and post it to the list for review in the coming weeks.<br>
><br>
> All we need now is great name for the -f flag ;-)<br>
<br>
</div>I like my bikesheds to be blue!<br>
<br>
-fcxx-style-attributes<br>
-fcxx-attributes<br>
<br>
I don't have a strong opinion on the name, but I do think that the<br>
feature flag should warn in nonsense situations (for instance<br>
-fno-cxx-attributes -std=c++11), or maybe even -fcxx-attributes<br>
-std=c++11 (since it's redundant, but I'm less tied to this).<br></blockquote></div><br></div><div class="gmail_extra">-fc++-attributes? We already have +s in -W and -std flags, why not in a -f flag? =)</div><div class="gmail_extra">
<br></div><div class="gmail_extra">I don't see any particular reason to disallow or warn about -std=c++11 -fno-c++-attributes, even though I don't immediately see a good reason to use that flag combination. We should allow -std=c++11 -fc++-attributes, so that software that compiles with or without c++11 but needs c++ attributes can use 'clang $std -fc++-attributes'.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I think the only remaining argument against this is that we've historically tried to avoid creating language dialects by allowing some language features but not others. We've seen the damage done to C and C++ by GNU extensions, and we want to avoid doing the same thing ourselves. The counterpoint is that the alternative (__attribute__) in this case is already a language extension.</div>
</div>