2 <clause number="15.5.2" title="Local constant declarations">
3 <paragraph>A <non_terminal where="15.5.2">local-constant-declaration</non_terminal> declares one or more local constants. <grammar_production><name><non_terminal where="15.5.2">local-constant-declaration</non_terminal></name> : <rhs><keyword>const</keyword><non_terminal where="11">type</non_terminal><non_terminal where="17.3">constant-declarators</non_terminal></rhs></grammar_production><grammar_production><name><non_terminal where="17.3">constant-declarator</non_terminal>s</name> : <rhs><non_terminal where="17.3">constant-declarator</non_terminal></rhs><rhs><non_terminal where="17.3">constant-declarators</non_terminal><terminal>,</terminal><non_terminal where="17.3">constant-declarator</non_terminal></rhs></grammar_production><grammar_production><name><non_terminal where="17.3">constant-declarator</non_terminal></name> : <rhs><non_terminal where="9.4.2">identifier</non_terminal><terminal>=</terminal><non_terminal where="14.15">constant-expression</non_terminal></rhs></grammar_production></paragraph>
4 <paragraph>The type of a <non_terminal where="15.5.2">local-constant-declaration</non_terminal> specifies the type of the constants introduced by the declaration. The type is followed by a list of <non_terminal where="17.3">constant-declarator</non_terminal>s, each of which introduces a new constant. A <non_terminal where="17.3">constant-declarator</non_terminal> consists of an identifier that names the constant, followed by an "=" token, followed by a <non_terminal where="14.15">constant-expression</non_terminal> (<hyperlink>14.15</hyperlink>) that gives the value of the constant. </paragraph>
5 <paragraph>The type and <non_terminal where="14.15">constant-expression</non_terminal> of a local constant declaration must follow the same rules as those of a constant member declaration (<hyperlink>17.3</hyperlink>). </paragraph>
6 <paragraph>The value of a local constant is obtained in an expression using a <non_terminal where="14.5.2">simple-name</non_terminal> (<hyperlink>14.5.2</hyperlink>). </paragraph>
7 <paragraph>The scope of a local constant is the block in which the declaration occurs. It is an error to refer to a local constant in a textual position that precedes its <non_terminal where="17.3">constant-declarator</non_terminal>. Within the scope of a local constant, it is a compile-time error to declare another local variable or constant with the same name. </paragraph>
8 <paragraph>A local constant declaration that declares multiple constants is equivalent to multiple declarations of single constants with the same type. </paragraph>