<div dir="ltr">On 21 January 2014 16:02, Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>></span> wrote:<br><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">
<div dir="ltr">Why not just say that we treat the expression as the body of a constexpr function? That nails down the semantics quite nicely.</div></blockquote><div><br></div><div>The problem I had with that is that it's very closely tied to C++. What about the interpretation of this same thing in C mode? I was hoping for a name for this kind of constant expression that gets evaluated with constant arguments slotted in, but if there isn't one then I guess I'll go with constexpr and let people implement more C++ rules in C mode. This whole thing already relies on overload resolution.</div>
<div><br></div><div>On 21 January 2014 15:12, Warren Hunt <span dir="ltr"><<a href="mailto:whunt@google.com" target="_blank">whunt@google.com</a>></span> wrote:<br><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">
<div dir="ltr">I don't know how to address your ambiguity in "evaluated by substituting" but I had a hard time reading "<span style="color:rgb(51,51,51);font-family:'DejaVu Sans',Arial,Helvetica,sans-serif;font-size:14px;line-height:21.600000381469727px;text-align:justify">and the reason supplied in the string will be given to the user if their code does not compile as a result". I would probably simply delete "the reason supplied in" or replace the phrase with "and the user provided string will be given if the code does not compile as a result".</span></div>
</blockquote><div><br></div><div>Good catch, that can be tightened without loss of meaning.</div></div><div><br></div><div>Nick</div><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">
<div class="gmail_extra"><div class="gmail_quote"><div class="im">
On Mon, Jan 20, 2014 at 7:36 PM, Nick Lewycky <span dir="ltr"><<a href="mailto:nlewycky@google.com" target="_blank">nlewycky@google.com</a>></span> wrote:<br></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">
<div><div class="h5">
<div dir="ltr">In the <a href="http://clang.llvm.org/docs/LanguageExtensions.html#controlling-overload-resolution" target="_blank">documentation for enable_if</a>, I have this paragraph: <div><br></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">
<span style="color:rgb(51,51,51);font-family:'DejaVu Sans',Arial,Helvetica,sans-serif;font-size:14px;line-height:21.600000381469727px;text-align:justify">An enable_if expression will be evaluated by substituting the values of the parameters from the call site into the arguments in the expression and determining whether the result is true. If the result is false or could not be determined through constant expression evaluation, then this overload will not be chosen and the reason supplied in the string will be given to the user if their code does not compile as a result.</span></blockquote>
<div><br>The problem I have with this is that "evaluated by substituting" is ambiguous. You could observe a different result if the implementation performed template-instantiation style substitution, as opposed what we actually do which is pretending that the expression was inside a constexpr function being called with the parameters from the call-site.<br>
</div><div><br></div><div>I do mention that we perform constant expression evaluation, but it sounds like that happens after the substitution. Is there some more precise language I could use to clarify exactly how the extension behaves?</div>
<span><font color="#888888">
<div><br></div><div>Nick</div></font></span></div>
<br></div></div><div class="im">_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">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>
<br></div></blockquote></div><br></div>
</blockquote></div></div></div>