-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add support for using aliases #1860
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
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.
It might be nice to beef up the new test with an alias template, e.g. something like
template<typename T>
struct S {
using X = T*;
};
using Y = S<int>::X;
And perhaps include t.getUnderlyingType()
in the query's select
statement.
Done - commit b524297 |
@@ -0,0 +1,2 @@ | |||
description: Differentiate between using aliases and typedefs | |||
compatibility: partial |
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.
On upgraded dbs it will look like every typedef is C-style. What are the applications you have in mind for this feature, and how will they be affected?
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 don't think there are any specific plans to use it right now, it just seemed like something the AST ought to distinguish. It seems plausible that someone might want to distinguish them in a query, for example when codifying a style guide. I don't think we need to be concerned about upgraded databases, though.
LGTM, except for the conflicts. |
The conflicts are due to @ian-semmle's DB schema upgrades - I'm rebasing to clear these out. |
3e6ee07
to
aabf515
Compare
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.
The QLDoc could be formatted better to align with our new style, but I won't let that hold up this PR. It has to be synced with the internal repo, so it's hard to get merged without conflict.
Previously these were identified as typedefs.
0d6422a
to
4606587
Compare
My first DB Schema change - can that be checked please.