Thanks for the info. Do you happen to know why C++11 has this rule?

I got into this as I noted the same was implemented in gcc 4.8 [1] while
working on attributes. There are several options:
- Forbid C++11 attributes on explicit template instantiations and treat
such program as ill formed.
- Issue a warning and ignore the attributes. This seems what gcc is doing.
- Issue a warning but not ignore the attributes. This allows existing
visibility attributes migrate to new syntax with same semantics.

Which is the right direction to go here?

[1]
http://gcc.gnu.org/viewcvs/trunk/gcc/cp/decl.c?r1=192199&r2=192198&pathrev=192199

Michael

On Tue, Dec 11, 2012 at 8:01 PM, John McCall <[email protected]> wrote:

> On Dec 7, 2012, at 3:08 PM, Michael Han <[email protected]> wrote:
> > This small patch forbids C++11 attributes on explicit template
> instantiations, as required by C++11 [dcl.attr.grammar] p4.
>
> Hmm.  It's easy to imagine attributes that are useful on explicit template
> instantiations.  We already support visibility attributes here (to override
> the visibility of the instantiated symbols), and we've discussed having an
> attribute which would guarantee a unique explicit instantiation (allowing
> the symbols to be emitted with strong linkage).  So this is a rather
> unfortunate language rule, and it undermines any argument that people ought
> to prefer the new syntax for existing attributes.
>
> John.
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to