﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">

<style type="text/css">

body { color: #000000; background-color: #FFFFFF; }
del { text-decoration: line-through; color: #8B0040; }
ins { text-decoration: underline; color: #005100; }

p.example { margin-left: 2em; }
pre.example { margin-left: 2em; }
div.example { margin-left: 2em; }

code.extract { background-color: #F5F6A2; }
pre.extract { margin-left: 2em; background-color: #F5F6A2;
  border: 1px solid #E1E28E; }

p.function { }
.attribute { margin-left: 2em; }
.attribute dt { float: left; font-style: italic;
  padding-right: 1ex; }
.attribute dd { margin-left: 0em; }

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: #FFEBFF;
  border: 1px solid #ECD7EC;
  padding-left: 0.5empadding-right: 0.5em; ; }

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

blockquote pre em { font-family: normal }

table { border: 1px solid black; border-spacing: 0px;
  margin-left: auto; margin-right: auto; }
th { text-align: left; vertical-align: top;
  padding-left: 0.8em; border: none; }
td { text-align: left; vertical-align: top;
  padding-left: 0.8em; border: none; }

</style>

<title>Attributes for namespaces and enumerators</title>
</head>
<body>

<div style="text-align: right; float: right">
<p>
ISO/IEC JTC1 SC22 WG21<br>
N4266 /
CWG 1657 /
EWG 113<br>
Richard Smith<br>
richard@metafoo.co.uk<br>
2014-11-05
</div>

<h1>Attributes for namespaces and enumerators</h1>

<h2><a name="Wording">Wording</a></h2>

<p>
Change in 7.2 (dcl.enum) paragraph 1:
<blockquote class="std">
[...]
<pre><em>enumerator:
        identifier <ins>attribute-specifier-seq<sub>opt</sub></ins>
</em></pre>

The optional <i>attribute-specifier-seq</i> in the <i>enum-head</i> and the <i>opaque-enum-declaration</i> appertains to the
enumeration; the attributes in that <i>attribute-specifier-seq</i> are thereafter considered attributes of the enumeration whenever it is named.
[...]
</blockquote>
</p>

<p>
Change in 7.2 (dcl.enum) paragraph 2:
<blockquote class="std">
[...]
The identifiers in an
<i>enumerator-list</i> are declared as constants, and can appear wherever constants are required.
An <i>enumerator-definition</i> with <tt>=</tt> gives the associated enumerator the value indicated by the <i>constant-expression</i>. If the first
enumerator has no initializer, the value of the corresponding constant is zero. An <i>enumerator-definition</i>
without an initializer gives the enumerator the value obtained by increasing the value of the previous
<i>enumerator by one</i>. [ <i>Example:</i> &hellip; ]
<ins>
The optional <i>attribute-specifier-seq</i> in an <i>enumerator</i> appertains to that enumerator.
</ins>
</blockquote>

<p>
Change in 7.3 (namespace.def) paragraph 1:
<blockquote class="std">
[...]
<pre><em>original-namespace-definition:
        </em>inline<em><sub>opt</sub> </em>namespace<em> <ins>attribute-specifier-seq<sub>opt</sub></ins> identifier </em>{<em> namespace-body </em>}<em>
extension-namespace-definition:
        </em>inline<em><sub>opt</sub> </em>namespace<em> <ins>attribute-specifier-seq<sub>opt</sub></ins> original-namespace-name </em>{<em> namespace-body </em>}<em>
unnamed-namespace-definition:
        </em>inline<em><sub>opt</sub> </em>namespace<em> <ins>attribute-specifier-seq<sub>opt</sub></ins> </em>{<em> namespace-body </em>}<em>
namespace-body:
        declaration-seq<sub>opt
</em></pre>
</blockquote>

<p>
Add a new paragraph after 7.3 (namespace.def) paragraph 7:
<blockquote class="stdins">
The optional <i>attribute-specifier-seq</i> in an
<i>original-namespace-definition</i> or <i>extension-namespace-definition</i>
appertains to the namespace being defined or extended.
</blockquote>

<p>
Change in 7.3.1.1 (namespace.unnamed) paragraph 1:
<blockquote class="std">
An <em>unnamed-namespace-definition</em> behaves as if it were replaced by
<pre>
inline<sub>opt</sub> namespace <b><em>unique</em></b> { /* empty body */ }
using namespace <b><em>unique</em></b> ;
namespace <em>attribute-specifier-seq</em> <b><em>unique</em></b> { <em>namespace-body</em> }
</pre>
where <tt>inline</tt> appears if and only if it appears in the
<em>unnamed-namespace-definition</em>, all occurrences of <b><em>unique</em></b> in a
translation unit are replaced by the same identifier, and this identifier
differs from all other identifiers in the entire program.
[Footnote: &hellip;]
<ins>The optional <em>attribute-specifier-seq</em> in the <em>unnamed-namespace-definition</em>
appertains to <b><em>unique</em></b>.</ins>
</blockquote>

<p>
Change in 7.6.5 (dcl.attr.deprecated) paragraph 2:
<blockquote class="std">
The attribute may be applied to the declaration of a class, a typedef-name, a variable, a non-static data
member, a function, <ins>a namespace,</ins> an enumeration, <ins>an enumerator,</ins> or a template specialization.
</blockquote>
