C++0x attributes

Hi @all,

maybe the question is a little bit early given that current C++ support is still incomplete, but anyway here we go:
are there any ongoing or planned efforts to implement attributes (syntax: [[attribute]], §7.6 in current draft) in clang?
An implementation targetting the parser and AST components as a first step would be already sufficient for me.
Thus I could and would dig into it (I just need something like parfor to overcome these openmp-like pragma hell).
Then someone (else) could work on the trickier codegen part and implement the semantics of the predefined attributes.

Best regards
Olaf Krzikalla

clang already has a parser of C++0x attributes. It's a bit dated though, as it does not reflect many changes made in the FCD. My SOC proposal focuses on cleaning up attributes a lot. If I am not accepted, I will do the same work but at a slower pace.

The standard [[final]], [[noreturn]], and [[aligned]] attributes are supported. [[base_check]], [[override]], [[hiding]], and [[carries_dependency]] are currently parsed and ignored, although the name-checking attributes are checked to make sure they appear on the correct sort of declaration.

Sean

Sean Hunt schrieb:

  

Hi @all,

maybe the question is a little bit early given that current C++ support
is still incomplete, but anyway here we go:
are there any ongoing or planned efforts to implement attributes
(syntax: [[attribute]], §7.6 in current draft) in clang?
An implementation targetting the parser and AST components as a first
step would be already sufficient for me.
Thus I could and would dig into it (I just need something like parfor
to overcome these openmp-like pragma hell).
Then someone (else) could work on the trickier codegen part and
implement the semantics of the predefined attributes.

Best regards
Olaf Krzikalla
    
clang already has a parser of C++0x attributes. It's a bit dated though, as it does not reflect many changes made in the FCD. My SOC proposal focuses on cleaning up attributes a lot. If I am not accepted, I will do the same work but at a slower pace.
  

OK, sounds good for me anyway. Of course it would be better as a SOC project. Where can I sign as a proponent? :slight_smile:
I found the "old" attribute support in the clang code, however I wasn't aware of the fact that the parser already handles the [[]] syntax.
Though one important thing is the possibility to attach attributes to statements. If I didn't overlooked something, for the moment you can attach them to declarations only.
Another thing is the ability to add implementation-defined attributes by external code (e.g. I'm working on a source-to-source transformator based on clang and I know of other people doing the same).

Best regards
Olaf Krzikalla