Missing attribute-using prefix in attribute representation
Closed this issue · 1 comments
Currently, in IPR we have four forms of attributes:
BasicAttribute = Token
ScopedAttribute = Token :: Token
LabeledAttribute = Token : Attribute
CalledAttribute = Token ( BalancedAttributeSeq )
There is one more element related to attributes supported by C++ grammar that is not currently represented by the IPR.
[ [ attribute-using-prefix-opt attribute-list ] ]
where attribute-using-prefix isusing
attribute-namespace:
Probably we will need something like:
struct NamespacedAttribute: Attribute {
virtual const Token& Namespace() const = 0;
virtual const BalancedAttributeSequence& attributes() const = 0;
};
Additionally, the current representation misses expansion of attributes (whatever that means).
Furthermore, to support some (misguided) common dialect extensions, there is a need to embed expressions within attributes, explicitly contrary to the requirement of the C++ standards which stipulate that No name lookup is performed on any of the identifiers contained in an attribute-token.
Note that those are orthogonal to the attribute-like notation used for C++20 contracts. But, for generality, it looks like we might have to make embedding of expression in attributes possible.