[cfe-dev] help wordsmithing documentation?

Nick Lewycky nlewycky at google.com
Mon Jan 20 16:36:56 PST 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140120/11e7da9b/attachment.html>


More information about the cfe-dev mailing list