Skip to content

Commit

Permalink
Merge pull request #17740 from jketema/requires
Browse files Browse the repository at this point in the history
C++: Add support for C++ requires expressions
  • Loading branch information
jketema authored Oct 15, 2024
2 parents 24d98ee + 168f7f5 commit 50ec254
Show file tree
Hide file tree
Showing 16 changed files with 10,925 additions and 1,323 deletions.
17 changes: 17 additions & 0 deletions cpp/downgrades/e51fad7a2436caefab0c6bd52f05e28e7cce4d92/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 isExprRequirement(Expr expr) {
exists(int kind | exprs(expr, kind, _) | kind = [391, 392, 393])
}

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

0 comments on commit 50ec254

Please sign in to comment.