Skip to content

Commit 082c712

Browse files
committed
Replace Block by BlockStmt in basic C/C++ query documentation
`Block` has be deprecated in favor of `BlockStmt`.
1 parent 1cfd222 commit 082c712

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/codeql/codeql-language-guides/basic-query-for-cpp-code.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Running the query
3737
3838
import cpp
3939
40-
from IfStmt ifstmt, Block block
40+
from IfStmt ifstmt, BlockStmt block
4141
where ifstmt.getThen() = block and
4242
block.getNumStmt() = 0
4343
select ifstmt, "This 'if' statement is redundant."
@@ -81,10 +81,10 @@ After the initial ``import`` statement, this simple query comprises three parts
8181
+===============================================================+===================================================================================================================+========================================================================================================================+
8282
| ``import cpp`` | Imports the standard CodeQL libraries for C/C++. | Every query begins with one or more ``import`` statements. |
8383
+---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
84-
| ``from IfStmt ifstmt, Block block`` | Defines the variables for the query. | We use: |
84+
| ``from IfStmt ifstmt, BlockStmt block`` | Defines the variables for the query. | We use: |
8585
| | Declarations are of the form: | |
8686
| | ``<type> <variable name>`` | - an ``IfStmt`` variable for ``if`` statements |
87-
| | | - a ``Block`` variable for the statement block |
87+
| | | - a ``BlockStmt`` variable for the statement block |
8888
+---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
8989
| ``where ifstmt.getThen() = block and block.getNumStmt() = 0`` | Defines a condition on the variables. | ``ifstmt.getThen() = block`` relates the two variables. The block must be the ``then`` branch of the ``if`` statement. |
9090
| | | |

0 commit comments

Comments
 (0)