<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 16, 2014 at 5:17 PM, Robinson, Paul <span dir="ltr"><<a href="mailto:Paul_Robinson@playstation.sony.com" target="_blank">Paul_Robinson@playstation.sony.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-family:"Arial","sans-serif";color:#222222;background:white">On Thu, Oct 16, 2014 at 12:58 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank"><span style="color:#1155cc">richard@metafoo.co.uk</span></a>> wrote:</span><span style="font-family:"Arial","sans-serif";color:#222222"><br>
<br>
</span><u></u><u></u></p><span class="">
<p class="MsoNormal" style="margin-left:.5in;background:white"><span style="font-family:"Arial","sans-serif";color:#222222">I have an additional suggestion: we treat tests that do not explicitly specify a language standard as testing *all* language modes. By
default, we continue to run them only in the default language mode of the clang driver, but we:<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:.5in;background:white"><span style="font-family:"Arial","sans-serif";color:#222222"> -- Add a driver and cc1 flag to set a default language mode for each language<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:.5in;background:white"><span style="font-family:"Arial","sans-serif";color:#222222"> -- Add a buildbot that runs all tests with the default language mode set to each possible value<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:.5in;background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:.5in;background:white"><span style="font-family:"Arial","sans-serif";color:#222222">This will prevent us from losing most of our C99 test coverage when we switch our default (and would also prevent us from losing most
of our C++98 test coverage if/when we switch our default C++ language mode to C++11). The added driver flag might also be useful to people who aren't ready for our new default yet.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:.5in;background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:.5in;background:white"><span style="font-family:"Arial","sans-serif";color:#222222">For the new flag, how about -std-default=c99 ?<u></u><u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><u></u> <u></u></span></p>
</span><p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">Seems like sufficient lit.cfg magic could vary the substitution of the %clang[_cc1] variables to supply -std=whatever. As long as Clang's -std option
parsing takes the last-one-specified without complaint, any test that explicitly specified -std would still obey that option. No clang changes needed. One bot per non-default-dialect would be sufficient.</span></p></div></div></blockquote><div><br></div><div>That doesn't work: we reject -std=c99 for C++ compiles, and reject -std=c++98 for C compiles. I believe that's the correct behaviour. What we want to say is "use this language standard by default for C compilations" in a way that doesn't break if the compilation is C++. That's actually a useful feature independent of any changes to how we test Clang.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">There would be some period of pain while smoking out the tests that actually did depend on the older dialect. As a data point, when Sony privately switched
to default to C++11, we added –std to something like 100-150 tests to get them to pass again, but the rest were all fine.</span></p></div></div></blockquote><div><br></div><div>That's an interesting datapoint. Did you find any bugs in this process, or were all the changes between C++98 and C++11 modes things like extension warnings going away? </div></div></div></div>