<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 21 January 2014 22:12, Ville Voutilainen <span dir="ltr">&lt;<a href="mailto:ville.voutilainen@gmail.com" target="_blank">ville.voutilainen@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 22 January 2014 03:40, David Krauss &lt;<a href="mailto:david_work@me.com">david_work@me.com</a>&gt; wrote:<br>

&gt;&gt;&gt; 1. Violation of “shall” is diagnosable unless otherwise specified (1.4/1).<br>
&gt;&gt; Ok. I don&#39;t think this is obviously clear.<br>
&gt; No? It’s the usual blanket rule. Not clear if that’s how compliance works, or if it applies in this instance?<br>
<br>
</div>Both.</blockquote><div><br></div><div>1.4/2, bullet 2, seems clear to me: this is a diagnosable rule, so a conforming implementation must issue at least one diagnostic for a program that violates it. (After doing so, if the implementation accepts it anyway, the behavior of the program is undefined, as for any diagnosable rule.)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
&gt;&gt;&gt; 2. I would take “use” to mean ODR-use.<br>
&gt;&gt; I wouldn&#39;t, I would take &quot;use&quot; to mean any use, not just odr-use.<br>
&gt; Well, a definition is also a use, in the sense that the name is looked up. Also the linkage is implementation-defined, while if no aspect could ever be inspected, it might as well be merely implementation-specific.<br>

&gt; I don’t see what utility other uses could have though, given that ODR-use isn’t allowed.<br>
<br>
</div>I don&#39;t think decltype(main()) is an odr-use, or sizeof(decltype(main)).</blockquote><div><br></div><div>C++98&#39;s mention of &#39;use&#39; had a cross-reference to 3.2 [basic.def.odr]. C++11 no longer has the cross-reference, and was *not* changed to say &#39;odr-use&#39;, so I expect it means *any* use.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
&gt;&gt;&gt; 3. Far as I know, the implementation is allowed to perform dynamic initialization of globals in main. So for all intents and purposes, it’s not really usable as a function because its body doesn’t describe what it does.<br>

&gt;&gt; Well, apparently some implementations think they can get away with it<br>
&gt;&gt; under the auspices of undefined behavior. :)<br>
&gt; Eh… each implementation is ultimately written for the satisfaction of its own customers, and there are enough folks who like to recurse main.<br>
<br>
</div>Really?<br>
<div class="im"><br>
&gt; I don’t recall ever seeing an implementation not to allow safe recursion of main. Often the C runtime<br>
<br>
</div>gcc doesn&#39;t allow it if given -pedantic.</blockquote><div><br></div><div>Clang trunk also doesn&#39;t allow it with -pedantic-errors. Both GCC and Clang reject decltype(main()) too, in strictly-conforming mode. EDG rejects odr-uses of main but accepts uses that are not odr-uses.</div>
</div></div></div>