Topic: Should names used in the initializer of an object of


Author: Brian Bi <bbi5291@gmail.com>
Date: Mon, 6 Feb 2017 22:12:59 -0800
Raw View
--001a114a91bcd8ab7d0547eaa3b3
Content-Type: text/plain; charset=UTF-8

For example, should the following code be made well-formed?

enum class Color {
    RED,
    GREEN,
    BLUE,
};

Color color = RED;

It seems that some code could be broken by this change, since RED could be
the name of a variable declared somewhere else, but this is probably rare.

--
*Brian Bi*

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAMmfjbP44DFNHwVogEBL%2BLHjRXrK2hOZH-5LQLgVDmK%3DJSoqcg%40mail.gmail.com.

--001a114a91bcd8ab7d0547eaa3b3
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">For example, should the following code be made well-formed=
?<br><div><br><span style=3D"font-family:monospace,monospace">enum class Co=
lor {<br></span></div><div><span style=3D"font-family:monospace,monospace">=
=C2=A0=C2=A0=C2=A0 RED,<br></span></div><div><span style=3D"font-family:mon=
ospace,monospace">=C2=A0=C2=A0=C2=A0 GREEN,<br></span></div><div><span styl=
e=3D"font-family:monospace,monospace">=C2=A0=C2=A0=C2=A0 BLUE,<br></span></=
div><div><span style=3D"font-family:monospace,monospace">};<br></span></div=
><div><span style=3D"font-family:monospace,monospace"><br></span></div><div=
><span style=3D"font-family:monospace,monospace">Color color =3D RED;</span=
><br clear=3D"all"></div><div><div><div><br></div><div>It seems that some c=
ode could be broken by this change, since RED could be the name of a variab=
le declared somewhere else, but this is probably rare.<br></div><div><br>--=
 <br><div class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div=
 dir=3D"ltr"><div><div dir=3D"ltr"><font color=3D"#c0c0c0"><i>Brian Bi</i><=
/font><br><div></div><div></div><div></div></div></div></div></div>
</div></div></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAMmfjbP44DFNHwVogEBL%2BLHjRXrK2hOZH-=
5LQLgVDmK%3DJSoqcg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAMmfjbP44DFN=
HwVogEBL%2BLHjRXrK2hOZH-5LQLgVDmK%3DJSoqcg%40mail.gmail.com</a>.<br />

--001a114a91bcd8ab7d0547eaa3b3--

.