[cfe-dev] C++11 attributes parsing
Joshua Cranmer
pidgeot18 at gmail.com
Fri Jul 6 11:01:10 PDT 2012
On 7/6/2012 1:29 PM, John McCall wrote:
> On Jul 6, 2012, at 7:16 AM, Alexander Kornienko wrote:
>> The whole purpose of this e-mail is to gather ideas regarding our needs for C++11 attributes parsing. Right now, only select attributes are parsed in C++11 style, attribute arguments parsing is not implemented, there's no common check for matching attribute targets ("Subjects" field in Attr.td). BTW, AFAIK, the latter is not implemented for GNU-style attributes either.
>>
>> Currently, I see the following questions:
>> 1. will we allow c++11 syntax for existing GNU attributes?
> Probably not. If we do, there's a potential for collision with attributes introduced by the committee. It doesn't seem to have any benefits except giving users a prettier syntax for writing code that is totally unportable between compilers.
The C++11 attributes do put things into a namespace, so it's possible to
make [[clang::magic_attr]]. The committee also appears to imply that
vendors should move from using things like __attribute__ to the C++11
stuff (N2671 gives examples that have ibm::, gnu::, etc. in places).
My opinion is to put any new attributes we want to include in C++11
attributes with a clang:: prefix. As for migrating pre-existing
GNU-style attributes, the best answer is to wait and see what gcc will do.
--
Joshua Cranmer
News submodule owner
DXR coauthor
More information about the cfe-dev
mailing list