-
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 #18502 from jketema/consteval
C++: Support `if consteval` and `if ! consteval`
- Loading branch information
Showing
25 changed files
with
11,929 additions
and
1,216 deletions.
There are no files selected for viewing
2,429 changes: 2,429 additions & 0 deletions
2,429
cpp/downgrades/1aa71a4a687fc93f807d4dfeeef70feceeced242/old.dbscheme
Large diffs are not rendered by default.
Oops, something went wrong.
2,415 changes: 2,415 additions & 0 deletions
2,415
cpp/downgrades/1aa71a4a687fc93f807d4dfeeef70feceeced242/semmlecode.cpp.dbscheme
Large diffs are not rendered by default.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
cpp/downgrades/1aa71a4a687fc93f807d4dfeeef70feceeced242/stmts.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,17 @@ | ||
class Stmt extends @stmt { | ||
string toString() { none() } | ||
} | ||
|
||
class Location extends @location_stmt { | ||
string toString() { none() } | ||
} | ||
|
||
predicate isConstevalIf(Stmt stmt) { | ||
exists(int kind | stmts(stmt, kind, _) | kind = 38 or kind = 39) | ||
} | ||
|
||
from Stmt stmt, int kind, int kind_new, Location location | ||
where | ||
stmts(stmt, kind, location) and | ||
if isConstevalIf(stmt) then kind_new = 7 else kind_new = kind // Turns consteval if into a block with two block statements in it | ||
select stmt, kind_new, location |
5 changes: 5 additions & 0 deletions
5
cpp/downgrades/1aa71a4a687fc93f807d4dfeeef70feceeced242/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,5 @@ | ||
description: Support (not) consteval if | ||
compatibility: full | ||
consteval_if_then.rel: delete | ||
consteval_if_else.rel: delete | ||
stmts.rel: run stmts.qlo |
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 @@ | ||
--- | ||
category: feature | ||
--- | ||
* A new class `ConstevalIfStmt` was introduced, which represents the C++23 `if consteval` and `if ! consteval` statements. |
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
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
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
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.