[cfe-dev] [concepts] Should requires-expressions contain a decl?
Hubert Tong via cfe-dev
cfe-dev at lists.llvm.org
Tue Jul 10 15:35:56 PDT 2018
On Tue, Jul 10, 2018 at 4:29 PM, Saar Raz <saar at raz.email> wrote:
> On Tue, Jul 10, 2018 at 4:40 PM Hubert Tong <hubert.reinterpretcast at gmail.
> com> wrote:
>
>> I believe for the similar case of "auto" variables, we produce the
>> template parameter list on the stack.
>>
> With compound requirements, you have a complete abstract-declarator as
> part of the deduced-against types, which can reference the template
> parameter in all manner of ways. That's what led me to store the template
> parameter list - do you see a specific problem with storing it?
>
I don't see a problem with storing it other than the usual concerns around
memory usage. The template parameter list is an artifact that is mainly
useful for performing the deduction, but the deduction is not likely to
occur with every instance of the "same" *requires-expression*. The
information for the *return-type-requirement* can be stored as a type. This
is straightforward for the *trailing-return-type* case. For the latter
case, I think it is not a stretch to implement a derived class of
clang::DeducedType that represents a constrained placeholder type.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180710/f77f6d37/attachment.html>
More information about the cfe-dev
mailing list