[cfe-dev] help wordsmithing documentation?

Sean Silva silvas at purdue.edu
Tue Jan 21 16:02:17 PST 2014


Why not just say that we treat the expression as the body of a constexpr
function? That nails down the semantics quite nicely.

-- Sean Silva


On Mon, Jan 20, 2014 at 7:36 PM, Nick Lewycky <nlewycky at google.com> wrote:

> In the documentation for enable_if<http://clang.llvm.org/docs/LanguageExtensions.html#controlling-overload-resolution>,
> I have this paragraph:
>
> 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.
>
>
> 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.
>
> 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?
>
> Nick
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140121/6ff307a2/attachment.html>


More information about the cfe-dev mailing list