mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C++: add tests for ArrayType typedef resolution
This commit is contained in:
7
cpp/ql/test/library-tests/typedefs/ArrayTypedefs.cpp
Normal file
7
cpp/ql/test/library-tests/typedefs/ArrayTypedefs.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
typedef int int_t;
|
||||
int_t g1[10];
|
||||
int_t g2[2][4];
|
||||
|
||||
typedef float float_t;
|
||||
float_t arr1[5];
|
||||
float_t (*a_pointer)[10];
|
||||
@@ -0,0 +1,5 @@
|
||||
| file://:0:0:0:0 | float_t[5] | file://:0:0:0:0 | float_t[5] | ArrayTypedefs.cpp:6:9:6:12 | definition of arr1 |
|
||||
| file://:0:0:0:0 | float_t[10] | file://:0:0:0:0 | float_t[10] | ArrayTypedefs.cpp:7:11:7:19 | definition of a_pointer |
|
||||
| file://:0:0:0:0 | int_t[2][4] | file://:0:0:0:0 | int_t[2][4] | ArrayTypedefs.cpp:3:7:3:8 | definition of g2 |
|
||||
| file://:0:0:0:0 | int_t[4] | file://:0:0:0:0 | int_t[4] | ArrayTypedefs.cpp:3:7:3:8 | definition of g2 |
|
||||
| file://:0:0:0:0 | int_t[10] | file://:0:0:0:0 | int_t[10] | ArrayTypedefs.cpp:2:7:2:8 | definition of g1 |
|
||||
4
cpp/ql/test/library-tests/typedefs/ArrayTypedefs.ql
Normal file
4
cpp/ql/test/library-tests/typedefs/ArrayTypedefs.ql
Normal file
@@ -0,0 +1,4 @@
|
||||
import cpp
|
||||
|
||||
from ArrayType type
|
||||
select type, type.resolveTypedefs(), type.getATypeNameUse()
|
||||
Reference in New Issue
Block a user