[cfe-commits] [Patch] Forbid C++11 attributes on explicit template instantiation.

Michael Han fragmentshaders at gmail.com
Sat Dec 8 10:25:11 PST 2012


Patch updated. The attributes are "dropped" by marking as invalid so they
don't participate in semantic checking.

Cheers
Michael

On Fri, Dec 7, 2012 at 3:41 PM, Michael Han <fragmentshaders at gmail.com>wrote:

> I think we should. I'll update the patch.
>
> This reminds me another place that needs a fix - in
> ParseCXX11AttributeSpecifier, when there is a parsing error (e.g. missing
> trailing square brackets), the attributes should also be dropped (or maybe
> they should not be added to attribute list in first place until we finish
> parsing the entire attribute list...)
>
> Cheers
> Michael
>
>
> On Fri, Dec 7, 2012 at 3:32 PM, Richard Smith <richard at metafoo.co.uk>wrote:
>
>> Hi,
>>
>> Some more test cases:
>>
>> template [[attr]] void f<int>();
>> template class [[attr]] S1<char>;
>>
>> Do we need to drop the attributes from the ParsingDeclarator after
>> diagnosing them?
>>
>> On Fri, Dec 7, 2012 at 3:08 PM, Michael Han <fragmentshaders at gmail.com>
>> wrote:
>> > Hi,
>> >
>> > This small patch forbids C++11 attributes on explicit template
>> > instantiations, as required by C++11 [dcl.attr.grammar] p4.
>> >
>> > Cheers
>> > Michael
>> >
>> > _______________________________________________
>> > cfe-commits mailing list
>> > cfe-commits at cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>> >
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121208/07816dc8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: templateattr.patch
Type: application/octet-stream
Size: 3069 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121208/07816dc8/attachment.obj>


More information about the cfe-commits mailing list