<div dir="ltr">On Fri, Sep 6, 2013 at 5:50 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Okay, so why did this work for me on ToT on Windows prior to your<br>
patch?  Do we have different constructor disambiguation for<br>
-fms-compatibility?</blockquote><div><br></div><div>-fms-extensions enables recognition of the single-square-bracket (IDL-style) attribute syntax, which it seems we just silently ignore. So when we were testing whether this looks like a constructor in MS mode, we skipped over the attribute. (But when actually parsing it, we'd still parse it as a C++11 attribute.)</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
~Aaron<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Thu, Sep 5, 2013 at 8:15 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
> On Thu, Sep 5, 2013 at 12:50 PM, Guillaume Papin<br>
> <<a href="mailto:guillaume.papin@epitech.eu">guillaume.papin@epitech.eu</a>> wrote:<br>
>><br>
>> Hum, I updated yesterday so it's quite recent. I tried the following<br>
>> with both my system-wide install of clang (version 3.2) and the one I<br>
>> built after my update yesterday:<br>
>><br>
>>   [papin_g:~/GSoC/build]$ cat /tmp/gnu-unused.cpp<br>
>>   struct AB {<br>
>>     AB([[gnu::unused]] int i) {}<br>
>>     void f([[gnu::unused]] int i) {} // no error for this line<br>
>>   };<br>
>>   [papin_g:~/GSoC/build]$ ./bin/clang++ -std=c++11 -fsyntax-only<br>
>> /tmp/gnu-unused.cpp<br>
>>   /tmp/gnu-unused.cpp:2:6: error: expected member name or ';' after<br>
>> declaration specifiers<br>
>>     AB([[gnu::unused]] int i) {}<br>
>>     ~~ ^<br>
>>   /tmp/gnu-unused.cpp:2:6: error: an attribute list cannot appear here<br>
>>     AB([[gnu::unused]] int i) {}<br>
>>        ^~~~~~~~~~~~~~~<br>
>>   /tmp/gnu-unused.cpp:2:22: error: expected ')'<br>
>>     AB([[gnu::unused]] int i) {}<br>
>>                        ^<br>
>>   /tmp/gnu-unused.cpp:2:5: note: to match this '('<br>
>>     AB([[gnu::unused]] int i) {}<br>
>>       ^<br>
>>   3 errors generated.<br>
>><br>
>><br>
>> I will update Clang tomorrow and see if the problem persists. Maybe it's<br>
>> only me and I checked out at the wrong time or it's has been fixed since<br>
>> yesterday.<br>
><br>
><br>
> This was a bug in our disambiguation of constructor / non-constructor<br>
> declarations. Fixed in r190111, thanks.<br>
><br>
>><br>
>> Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>> writes:<br>
>><br>
>> > On Thu, Sep 5, 2013 at 11:49 AM, Guillaume Papin<br>
>> > <<a href="mailto:guillaume.papin@epitech.eu">guillaume.papin@epitech.eu</a>> wrote:<br>
>> >> Hi,<br>
>> >><br>
>> >> While testing some code with attributes I found the following that<br>
>> >> looks<br>
>> >> like a bug to me:<br>
>> >><br>
>> >>   $ clang-check /tmp/unused.cpp -- -std=c++11<br>
>> >><br>
>> >>   struct AB {<br>
>> >>     AB([[gnu::unused]] int i) {}<br>
>> >>     // ^~~~~~~~~~~~~~~ /tmp/unused.cpp:2:5: error: an attribute list<br>
>> >> cannot appear here<br>
>> >><br>
>> >>     void f([[gnu::unused]] int i) {} // no error for this line<br>
>> >>   };<br>
>> >><br>
>> >> Do constructors have different parameter-declaration-list than member<br>
>> >> functions?<br>
>> ><br>
>> > They do not -- are you using ToT?  I get no errors with your code on a<br>
>> > relatively recent build.<br>
>> ><br>
>> > ~Aaron<br>
>> ><br>
>><br>
>> --<br>
>> Guillaume Papin<br>
>><br>
>> _______________________________________________<br>
>> cfe-dev mailing list<br>
>> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
><br>
><br>
</div></div></blockquote></div><br></div></div>