Document number:P0028R4
Date: 2016-06-22
Audience: Core Working Group


J. Daniel Garcia (josedaniel.garcia@uc3m.es)
Daveed Vandevoorde (daveed@edg.com)




Using attribute namespaces without repetition

Context

This paper provides wording for proposal P0028 as approved by Evolution Working Group (P0028R2 [1]). Please, note that paper P0028R2 provides rationale and change log.

Proposed Wording Changes

In 7.6.1/1, modify the production for attribute-specifier as follows:


attribute-specifier:
[ [ attribute-using-prefixopt attribute-list ] ]
alignment-specifier

attribute-using-prefix:
using attribute-namespace :

Insert a new paragraph immediately after 7.6.1/1:

If an attribute-specifier contains an attribute-using-prefix the attribute-list following that attribute-using-prefix shall not contain an attribute-scoped-token and every attribute-token in that attribute-list is treated as if its identifier were prefixed with N::, where N is the attribute-namespace specified in the attribute-using-prefix. [ Note: This rule imposes no constraints on how an attribute-using-prefix affects the tokens in an attribute-argument-clause.] [ Example:
[[ using CC: opt(1), debug ]] void f() {}
//
Same as [[ CC::opt(1), CC::debug ]] void f() {}
[[ using CC: opt(1)]][[ CC::debug ]] void g() {}
//
Okay (same effect as above).
[[ using CC: CC::opt(1) ]] void h() {}
//
error: cannot combine using and scoped attribute token
end example ]

Acknowledgements

The work from J. Daniel Garcia has received funding from the European Union Seventh Framework Programme (FP7/2007-2013) under grant agreement n. 609666.

Jens Maurer identified issues in previous version of this paper.

References

[1] J. Daniel Garcia, Luis M. Sanchez, Massimo Torquati, Marco Danelutto, and Peter Sommerlad. Using non-standard attributes. Technical Proposal P0028R2, ISO/IEC JTC1/SC22/WG21, March 2016.