-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18606 from jketema/typeref
C++: Support mixed `typedef`s and `using`s
- Loading branch information
Showing
12 changed files
with
10,844 additions
and
980 deletions.
There are no files selected for viewing
2,444 changes: 2,444 additions & 0 deletions
2,444
cpp/downgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/old.dbscheme
Large diffs are not rendered by default.
Oops, something went wrong.
2,432 changes: 2,432 additions & 0 deletions
2,432
cpp/downgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/semmlecode.cpp.dbscheme
Large diffs are not rendered by default.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
cpp/downgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
description: Mix typedefs and usings | ||
compatibility: full | ||
usertypes.rel: run usertypes.qlo | ||
usertype_alias_kind.rel: delete |
20 changes: 20 additions & 0 deletions
20
cpp/downgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/usertypes.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class UserType extends @usertype { | ||
string toString() { none() } | ||
} | ||
|
||
int getTyperefKind(UserType usertype) { | ||
usertype_alias_kind(usertype, 0) and | ||
result = 5 | ||
or | ||
usertype_alias_kind(usertype, 1) and | ||
result = 14 | ||
} | ||
|
||
bindingset[kind] | ||
int getKind(UserType usertype, int kind) { | ||
if kind = 18 then result = getTyperefKind(usertype) else result = kind | ||
} | ||
|
||
from UserType usertype, string name, int kind | ||
where usertypes(usertype, name, kind) | ||
select usertype, name, getKind(usertype, kind) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.