<br><br><div class="gmail_quote">On Mon, May 21, 2012 at 3:30 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="gmail_quote"><div><div>On Mon, May 21, 2012 at 7:08 AM, Fernando Pelliccioni <span dir="ltr"><<a href="mailto:fpelliccioni@gmail.com" target="_blank">fpelliccioni@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div><div class="gmail_quote">On Mon, May 21, 2012 at 9:22 AM, Fernando Pelliccioni <span dir="ltr"><<a href="mailto:fpelliccioni@gmail.com" target="_blank">fpelliccioni@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div><div>On Sun, May 20, 2012 at 3:19 PM, Sebastian Redl <span dir="ltr"><<a href="mailto:sebastian.redl@getdesigned.at" target="_blank">sebastian.redl@getdesigned.at</a>></span> wrote:</div>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><br><div><div><div>On 18.05.2012, at 21:09, Fernando Pelliccioni wrote:</div><br></div><blockquote type="cite"><div><div>Hi,</div><div><br></div><div>I have a doubt about this paragraph of [over.match.list] ...</div>





<div><br></div><blockquote style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:40px;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px">






<div>"If the initializer list has no elements and T has a default constructor, the first phase is omitted. In copy-listinitialization,</div><div>if an explicit constructor is chosen, the initialization is ill-formed. [ Note: This differs from</div>






<div>other situations (13.3.1.3, 13.3.1.4), where only converting constructors are considered for copy-initialization.</div><div>This restriction only applies if this initialization is part of the final result of overload resolution. —end note ]"</div>






</blockquote><div><br></div><div>According to the above, what should be the result of compiling the following code?</div></div><blockquote style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:40px;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px">





<div><br></div><div><div><font face="'courier new', monospace">struct my_string</font></div><div><font face="'courier new', monospace">{</font></div>
<div><font face="'courier new', monospace">  template<class InputIterator></font></div><div><font face="'courier new', monospace">  explicit my_string(InputIterator begin, InputIterator end);   // This is *not* a converting constructor.</font></div>






<div><font face="'courier new', monospace">};</font></div><div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">void foo( like_std_string );</font></div>






<div><font face="'courier new', monospace">void foo( std::pair<std::string, std::string> );</font></div><div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">void bar( my_string );</font></div>






<div><font face="'courier new', monospace">void bar( std::pair<std::string, std::string> );</font></div><div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">int main( /* int argc, char* argv[] */ )</font></div>






<div><font face="'courier new', monospace">{</font></div><div><font face="'courier new', monospace">  foo( {"k0", "v0"} );<span style="white-space:pre-wrap">       </span>// ambiguous in Clang (3.1) and GCC (4.7.1). OK, I think.</font></div>






<div><font face="'courier new', monospace">  bar( {"k0", "v0"} );<span style="white-space:pre-wrap">  </span>// *Not* ambiguous in Clang. Ambiguous in GCC. Ambiguous to the Standard? I think should *not* be ambiguous.</font></div>






</div></blockquote></blockquote>Did you try this with the most recent SVN version? I'm pretty sure this was reported as a bug and fixed before the 3.1 branch even.</div><span><font color="#888888"><div>
<br></div><div>Sebastian</div><br></font></span></div></blockquote></div><br></div></div><div><div>I tested with 3.1 (trunk 155038)</div><div><br></div><div>Updating and re-testing.</div><br></div>
</blockquote></div><br><div><br></div></div></div><div>Same effect on</div><div><br></div><div><div>$ clang++ --version</div><div>clang version 3.2 (trunk 157183)</div><div>Target: i386-pc-linux-gnu</div><div>Thread model: posix</div>




</div><div><br></div><div><br></div><div>I don't know if it is a bug ( I wish not )</div></blockquote><div><br></div></div></div><div>I also see this on ToT. It is a bug: the standard seems clear that 'explicit' does not affect the overload selected by overload resolution for list-initialization, and only acts to make the resulting call ill-formed.</div>


</div>
</blockquote></div><br><div><br></div><div><div>I know that Clang doesn't conform the Standard (in that paragraph) but ...</div><div>...thinking..., Is it a issue of the Standard?</div></div><div>I will ask this question in the right place.</div>

<div><br></div><div><br></div>