Committed as r163513.<div><br><div class="gmail_quote">On Mon, Sep 10, 2012 at 1:31 PM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Douglas, Chandler,<div><br></div><div>Please, take a look at the updated patch here: <a href="http://llvm-reviews.chandlerc.com/D38" target="_blank">http://llvm-reviews.chandlerc.com/D38</a><br>
<div><div><div class="h5"><br><div class="gmail_quote">On Mon, Sep 10, 2012 at 12:55 PM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote"><div><div>On Mon, Sep 10, 2012 at 12:07 AM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com" target="_blank">dgregor@apple.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto"><div><br>Sent from my iPhone</div><div><div><div>On Sep 8, 2012, at 6:55 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>> wrote:<br><br>
</div><blockquote type="cite"><div><div class="gmail_extra"><div class="gmail_quote">On Sat, Sep 8, 2012 at 6:10 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com" target="_blank">dgregor@apple.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sent from my iPhone<br>
<div><br>
On Sep 7, 2012, at 6:44 PM, Alexander Kornienko <<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>> wrote:<br>
<br>
> Author: alexfh<br>
> Date: Fri Sep  7 17:44:34 2012<br>
> New Revision: 163429<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=163429&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=163429&view=rev</a><br>
> Log:<br>
> Fixed <a href="http://llvm.org/bugs/show_bug.cgi?id=13777" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=13777</a><br>
><br>
> Modified:<br>
>    cfe/trunk/tools/clang-check/ClangCheck.cpp<br>
><br>
> Modified: cfe/trunk/tools/clang-check/ClangCheck.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-check/ClangCheck.cpp?rev=163429&r1=163428&r2=163429&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-check/ClangCheck.cpp?rev=163429&r1=163428&r2=163429&view=diff</a><br>




> ==============================================================================<br>
> --- cfe/trunk/tools/clang-check/ClangCheck.cpp (original)<br>
> +++ cfe/trunk/tools/clang-check/ClangCheck.cpp Fri Sep  7 17:44:34 2012<br>
> @@ -58,7 +58,9 @@<br>
>     "ast-dump-filter",<br>
>     cl::desc(Options->getOptionHelpText(options::OPT_ast_dump_filter)));<br>
><br>
> -namespace {<br>
> +// Anonymous namespace here causes problems with gcc <= 4.4 on MacOS:<br>
> +// <a href="http://llvm.org/bugs/show_bug.cgi?id=13777" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=13777</a><br>
> +// namespace {<br>
<br>
</div>How about just putting it in the clang namespace? At the very least, please delete the commented-out lines.<br></blockquote><div><br></div><div>Agreed on both fronts. Also, bugs are usually cited just as "PR13777", and almost never cited in the source code, but rather in the test case itself.</div>


</div></div></div></blockquote><div><br></div></div></div>The reasoning behind this is that the code and comments should stand alone. Nobody should have to hunt through a bug tracker to determine the intent. </div></blockquote>


</div></div><div>Thanks for the explanation, I didn't know this point.</div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">
<div>The test suite, on the other hand, is a mix of feature tests and regression tests that often grows in response to specific bugs, and the cross-linking to those bugs is a valuable addition. </div>
</div></blockquote></div><div>This is overall a reasonable statement. As for this specific case, I'm not sure I can come up with a sane test for this (this is not a functionality after all, and the bug is not in the source code, but in an external compiler). That's why I decided to put a link to the bug tracker item in the source file itself. And the second reason is that I wanted to provide more context to those who'll read this code, in addition to the short description immediately in comments.</div>

<div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><div><div><blockquote type="cite"><div><div class="gmail_extra"><div class="gmail_quote">


<div>That said, is this really the necessary solution? There are a lot of template arguments defined in an anonymous namespace within the codebase already. How do they work without problems?</div></div></div></div></blockquote>


<div><br></div></div>Yes, this is odd. </div></div></div></blockquote></div><div>I would suggest, that this can be the only place where a class from an unnamed namespace is used as a parameter of a template function, which has a local class. But I certainly don't want to find a complete and correct proof of this statement. It could be rather time consuming, and I'm sure it won't have much value.</div>

<div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><div><div><blockquote type="cite"><div><div class="gmail_extra"><div class="gmail_quote">



<div>I feel like this is an ODR violation waiting to happen unless we put it in an anonymous namespace the way it should be...</div><div><br></div><div>-Chandler</div></div></div>
</div></blockquote></div></div></div></div></blockquote></div></div><span><font color="#888888"><br>-- 
<div>Regards,</div><div>Alex</div></font></span></blockquote></div></div></div></div></div></blockquote></div>
</div>