[PATCH] Parse Microsoft __declspec appearing after class body

Alp Toker alp at nuanti.com
Sun Nov 24 12:29:14 PST 2013


On 24/11/2013 20:23, Aaron Ballman wrote:
> On Sun, Nov 24, 2013 at 1:42 PM, Alp Toker <alp at nuanti.com> wrote:
>> On 24/11/2013 14:40, Aaron Ballman wrote:
>>
>> What happens with this patch and the following ill-formed declaration:
>>
>> struct S {} __declspec(deprecated);
>>
>> Does this compile without error? If so, that would need to be
>> diagnosed (and regardless, this would be a good test to have). Note,
>> that code compiled with MSVC does not issue a diagnostic, but it also
>> doesn't apply the declspec to anything. I would say this should issue
>> a warning for us, and not apply the declspec to anything for greatest
>> compatibility vs utility.
>>
>>
>> My patch handles that correctly. Here's the test:
>>
>> test/SemaCXX/MicrosoftExtensions.cpp:416:26: warning: attribute 'deprecated'
>> is ignored, place it after "struct" to apply attribute to type declaration
>>    struct D {} __declspec(deprecated);
> Based on this, patch LGTM if you add this as a test somewhere.  :-)

Thanks! r195577

>
> ~Aaron

-- 
http://www.nuanti.com
the browser experts




More information about the cfe-commits mailing list