<div dir="ltr"><div>On Thu, Nov 14, 2013 at 2:50 PM, Sean McBride <span dir="ltr"><<a href="mailto:sean@rogue-research.com" target="_blank">sean@rogue-research.com</a>></span> wrote:<br></div><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi all,<br>
<br>
I'm not a language lawyer, but consider:<br>
<br>
----------------------<br>
#include <stdio.h><br>
<br>
static void PrintIt(double value)<br>
{<br>
printf("value is %f \n", value);<br>
}<br>
<br>
template <class T><br>
void Function(T *value)<br>
{<br>
PrintIt(*value);<br>
}<br>
<br>
int main ()<br>
{<br>
int x = 1;<br>
Function(&x);<br>
<br>
short y = 2;<br>
Function(&y);<br>
<br>
return x + y;<br>
}<br>
----------------------<br>
<br>
clang -std=c++03 -pedantic -Weverything test.cxx<br>
<br>
gives no warning/error. C++03 14.6.4.2 seems to say that, since PrintIt() is static, it should not be found. xlc generates an error:<br>
<br>
*The name lookup for "PrintIt" did not find a declaration.<br>
*Static declarations are not considered for a function call if the function is not qualified.<br>
<br>
Shouldn't clang be producing a diagnostic here?<br></blockquote><div><br></div><div>This rule was changed by DR561:</div><div><br></div><div><div><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#561">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#561</a><br>
</div><div class="gmail_extra"><br>This has status CD2, which means "CD2: A DR issue not resolved in CD1 but included in the Final Committee Draft advanced for balloting at the March, 2010 WG21 meeting." And DR means "DR: The full Committee has approved the item as a proposed defect report.", as opposed to "Accepted: Like a DR except that the issue concerns the wording of the current Working Paper rather than that of the current International Standard."</div>
</div></div><div class="gmail_quote"><br></div><div class="gmail_quote">That is, issue 561 was a defect in C++03 and the committee's intent was that the language not work that way. Our "C++03" mode is ISO C++03 plus defect reports, so includes this bug fix to C++03.</div>
<div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
(If I remove the static, clang's -Wmissing-prototypes complains; and if I add the static, xlc complains.)<br>
<br>
Thanks,<br>
<span class=""><font color="#888888"><br>
--<br>
____________________________________________________________<br>
Sean McBride, B. Eng <a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a><br>
Rogue Research <a href="http://www.rogue-research.com" target="_blank">www.rogue-research.com</a><br>
Mac Software Developer Montréal, Québec, Canada<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</font></span></blockquote></div><br></div></div>