[cfe-dev] [concepts] Should requires-expressions contain a decl?

Saar Raz via cfe-dev cfe-dev at lists.llvm.org
Sun Jul 8 23:21:03 PDT 2018


Hey,
I'm working on our concepts implementation and am pretty close to finishing
the implementation. All that's left is requires-expressions which I have
the code mostly written for, and am testing it now.
I came across a dilemma with requires-expressions and would like to know
what you guys think should happen.
We have requires expressions which declare local parameters - parameters
that need to be visible in the body of the requires-expression. The current
machinery would require such decls to reside in a declcontext which itself
should be a decl as it stands today.
Should requires-expr therefore be an expression linked to a generated decl?
The closest existing thing to this would be a lambda expression, but lambda
expressions cannot appear in unevaluated contexts while
requires-expressions clearly can.
Also, requires expressions as I have them now can contain another kind of
declaration - when using a constrained-parameter requirement (e.g. requires
{{ 0 } -> Same<int>;} ), a template parameter list with one parameter is
generated.

My initial thought seems to indicate a "RequiresExprBodyDecl : Decl,
DeclContext" is requires here, but I may be missing some implications of
this right now - are there any inherent problems with having this sort of
declaration generated here?

Thanks :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180709/d9a92aa2/attachment.html>


More information about the cfe-dev mailing list