mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
C++: Add Variable.isConstexpr()
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
|
||||
constexpr int var_constexpr = 5;
|
||||
int var_not_constexpr_initialised = 6;
|
||||
const int var_not_constexpr_const = 7;
|
||||
int var_not_constexpr;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
| constexpr.cpp:2:15:2:27 | var_constexpr | true |
|
||||
| constexpr.cpp:3:5:3:33 | var_not_constexpr_initialised | false |
|
||||
| constexpr.cpp:4:11:4:33 | var_not_constexpr_const | false |
|
||||
| constexpr.cpp:5:5:5:21 | var_not_constexpr | false |
|
||||
| file://:0:0:0:0 | fp_offset | false |
|
||||
| file://:0:0:0:0 | gp_offset | false |
|
||||
| file://:0:0:0:0 | overflow_arg_area | false |
|
||||
| file://:0:0:0:0 | p#0 | false |
|
||||
| file://:0:0:0:0 | p#0 | false |
|
||||
| file://:0:0:0:0 | reg_save_area | false |
|
||||
@@ -0,0 +1,5 @@
|
||||
import cpp
|
||||
|
||||
from Variable v
|
||||
select v,
|
||||
any(boolean b | if v.isConstexpr() then b = true else b = false)
|
||||
Reference in New Issue
Block a user