<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On Dec 22, 2013, at 1:58 PM, Alp Toker <<a href="mailto:alp@nuanti.com">alp@nuanti.com</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><span style="font-family: LucidaGrande;">On 22/12/2013 21:27, Dimitry Andric wrote:</span><br><blockquote type="cite" style="font-family: LucidaGrande; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Hi,<br><br>I ran into a situation where a C++ program was compiled with -Wsystem-headers. When I did this with clang 3.4 or trunk, I got the following keyword warnings:<br></blockquote><span style="font-family: LucidaGrande; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">[snipped]</span><br style="font-family: LucidaGrande; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite" style="font-family: LucidaGrande; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">include/type_traits:668:8: warning: keyword '__is_unsigned' will be made available as an identifier for the remainder of the translation unit [-Wkeyword-compat]<br>struct __is_unsigned : public ___is_unsigned<_Tp> {};<br> ^<br>9 warnings generated.<br><br>This seems to have been introduced with r196212 in clang by Alp Toker, but it is unfortunate the warning hits libc++. :-) The cause is a bunch of Embarcadero keywords defined in clang's lib/Parse/ParseExpr.cpp, which are exactly the same as these libc++-internal identifers.<br><br>Is the attached patch acceptable as a workaround?<br></blockquote><br style="font-family: LucidaGrande; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: LucidaGrande; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">Hi Dimitry,</span><br style="font-family: LucidaGrande; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br style="font-family: LucidaGrande; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: LucidaGrande; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">Thanks for looking into this. Your analysis of the situation is correct and the patch for libc++ is headed in the right direction.</span><br style="font-family: LucidaGrande; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></blockquote></div><br><div>I am strongly against this patch on several levels.</div><div><br></div><div>1) I would like to understand why (and how we came to) have two different sets of type traits implementations with the same name; one in libc++ and the other in the Embarcadero version of clang. Or maybe it’s not just in the Embarcadero version - though they are listed in TokenKinds.def as "Embarcadero Type Traits”</div><div><br></div><div>2). I would like to have a discussion about the *desirability* of having these in the compiler; clearly most of these type traits are implementable purely as a library.</div><div><br></div><div>3) I *hate* the idea of using “quad underscores” to differentiate names; I spent *two hours* a couple months ago trying to figure out why my code was failing, only to determine that I was calling __xxx instead of ___xxx. (triple underscore vs. double) If we decide to change libc++ for this, I would recommend renaming __is_void to something like __libcpp_is_void - something visually different.</div><div><br></div><div>— Marshall</div><div><br></div></body></html>