-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++: Support concept id expressions #18366
base: main
Are you sure you want to change the base?
Conversation
c843bfa
to
0f5b70a
Compare
0a8643e
to
a4e7505
Compare
If a type would be used in multiple places in the AST, rendering of the AST would be broken. Hence, we cannot directly use types as AST nodes.
a4e7505
to
94dabbc
Compare
|
||
private Type getTemplateArgumentType(int index) { | ||
exists(int i | if this.isTypeConstraint() then i = index - 1 else i = index | | ||
concept_template_argument(underlyingElement(this), i, unresolveElement(result)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that there's a trade-off in the design here: I follow what we do for the arguments in template instantiations, as concept ids are similar to those. Alternatively we could have added them as a kind of child expressions. The latter would have made the modifications to PrintAST somewhat simpler, but would have required custom code on the extractor-side, while in the current situation that shares code with template instantiations.
Pull Request checklist
All query authors
.qhelp
. See the documentation in this repository.Internal query authors only
.ql
,.qll
, or.qhelp
files. See the documentation (internal access required).