Skip to content

Commit

Permalink
C++: Add support for C++ requires expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
jketema committed Oct 11, 2024
1 parent 57c6e4d commit 005d8f4
Show file tree
Hide file tree
Showing 15 changed files with 9,537 additions and 15 deletions.
17 changes: 17 additions & 0 deletions cpp/downgrades/a8a5b3a2802accdcac431bd878e7899fa760a4d8/exprs.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class Expr extends @expr {
string toString() { none() }
}

class Location extends @location_expr {
string toString() { none() }
}

predicate isExprRequires(Expr expr) {
exists(int kind | exprs(expr, kind, _) | kind = 391 or kind = 392)
}

from Expr expr, int kind, int kind_new, Location location
where
exprs(expr, kind, location) and
if isExprRequires(expr) then kind_new = 1 else kind_new = kind
select expr, kind_new, location
Loading

0 comments on commit 005d8f4

Please sign in to comment.