-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C++: Support C23 typeof and typeof_unqual
#19290
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
Conversation
typeof and typeof_unqualtypeof and typeof_unqual
c95523d to
1849b4c
Compare
| class Type extends @type { | ||
| string toString() { none() } | ||
| } | ||
|
|
||
| class Expr extends @expr { | ||
| string toString() { none() } | ||
| } | ||
|
|
||
| from Type decltype, Expr expr, Type basetype, boolean parentheses | ||
| where decltypes(decltype, expr, _, basetype, parentheses) | ||
| select decltype, expr, basetype, parentheses |
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.
AFAIK this kind of projection can be written directly in the properties file by means of the reorder operator, without writing a ql file:
decltypes.rel: reorder decltypes.rel (int id, int expr, int kind, int basetype, boolean paren) id expr basetype paren
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.
Leaving this as is, but I'll keep this in mind when it ever comes up again.
|
|
||
| predicate typeTransformation(Type type, string name, int kind, Type type_id) { | ||
| type_operators(type, _, _, type_id) and | ||
| name = "" and |
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.
I'm guessing this name = "" means losing some information, but we're accepting that, right?
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.
Not really. I'm just projecting all the rows of the type_operators table on the derivedtypes table, to make sure I have some kind of type, but the derivedtypes table requires me to make up some kind of name.
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.
I could compute something based on the two columns of type_operators that I ignore here, but that doesn't seem to be worth the trouble.
redsun82
left a comment
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.
LGTM, only a downgrade script suggestion and a doubt, but nothing blocking 👍
No description provided.