<html>
<head>
<title>Using scoped attributes</title>
<style type="text/css">
blockquote.std { color: #000000; background-color: #F1F1F1;
                 border: 1px solid #D1D1D1;
                 padding-left: 0.5em; padding-right: 0.5em; }
blockquote.stddel { text-decoration: line-through;
                    color: #000000; background-color: #FFA0A0;
                    border: 1px solid #ECD7EC;
                    padding-left: 0.5em; padding-right: 0.5em; }

blockquote.stdins { color: #000000; background-color: #A0FFA0;
                    border: 1px solid #B3EBB3; padding: 0.5em; }

blockquote.stdrepl { color: #000000; background-color: #FFFFA0;
                    border: 1px solid #EBEBB3; padding: 0.5em; }


ins { background-color:#A0FFA0; text-decoration: none }
del { background-color:#FFA0A0; text-decoration: line-through; }
#hidedel:checked ~ * del, #hidedel:checked ~ * del * { display:none; visibility:hidden }

tab { padding-left: 4em; }
tab3 { padding-left: 3em; }
</style>
</head>
<body>
<p align=right>
Document number:<b>P0028R3</b><br/>
Date: <b>2016-03-15</b><br/>
Audience: <b>Core Working Group</b>
<p align=right>
<br/>J. Daniel Garcia (josedaniel.garcia@uc3m.es)
<br/>Daveed Vandevoorde (daveed@edg.com)
</p>

<BR><BR><HR>

<h1>Using non-standard attributes</h1>

<h3>Context</h3>

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

<h3>Proposed Wording Changes</h3>

<p>In 7.6.1/1, modify the production for <i>attribute-specifier</i> as follows:</p>
<blockquote class="std">
  <blockquote class="grammar">
    &hellip;<br/>
    <i>attribute-specifier:</i><br/>
    <tab><tt>[ [ </tt><i><ins>attribute-using<sub>opt</sub></ins>
               attribute-list</i><tt> ] ]</tt><br/>
    <tab><i>alignment-specifier</i><br/>
    <br/>
    <ins><i>attribute-using-prefix:</i></ins><br/>
    <tab><ins><tt>using </tt><i>attribute-namespace</i><tt> :</tt></ins><br/>
    &hellip;<br/>
  </blockquote>
</blockquote>


<p>Insert a new paragraph immediately after 7.6.1/1:</p>
<blockquote class="stdins">
If an <i>attribute-specifier</i> contains an <i>attribute-using-prefix</i>
the <i>attribute-list</i> following that <i>attribute-using-prefix</i> shall
not contain an <i>attribute-scoped-token</i> and every <i>attribute-token</i>
in that <i>attribute-list</i> is treated as if its 
<i>identifier</i> were prefixed with <tt><i>N</i>::</tt>, where
<tt><i>N</i></tt> is the <i>attribute-namespace</i> specified in the
<i>attribute-using-prefix</i>.
[&nbsp;<i>Example:</i>
  <blockquote><tt>
  <tab>[[ using CC: opt(1), debug ]] void f() {}<br/>
  <tab><tab>// </tt><i> Same as </i><tt> [[ CC::opt(1), CC::debug ]] void f() {}<br/>
  <tab>[[ using CC: opt(1)]][[ CC::debug ]] void g() {}<br/>
  <tab><tab>// </tt><i> Okay (same effect as above).</i><tt><br/>
  <tab>[[ using CC: CC::opt(1) ]] void h() {}<br/>
  <tab><tab>// </tt><i> error: cannot combine </i><tt>using</tt><i>
               and scoped attribute token</i><tt><br/>
  </tt></blockquote>
    &mdash;<i>end example</i> ]


</blockquote>

<h3>Acknowledgements</h3>

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

<h3>References</h3>

[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.

</body>
</html>


