mirror of
https://github.com/github/codeql.git
synced 2026-05-03 20:58:03 +02:00
C++: Add tests for using aliases
This commit is contained in:
10
cpp/ql/test/library-tests/using-aliases/using-alias.cpp
Normal file
10
cpp/ql/test/library-tests/using-aliases/using-alias.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
typedef int type1;
|
||||
using using1 = float;
|
||||
|
||||
typedef using1 type2;
|
||||
using using2 = type1;
|
||||
|
||||
template<typename T> struct S { using X = T*; };
|
||||
|
||||
using Y = S<int>::X;
|
||||
@@ -0,0 +1,9 @@
|
||||
| file://:0:0:0:0 | X | NestedTypedefType | file://:0:0:0:0 | int * |
|
||||
| file://:0:0:0:0 | X | UsingAliasTypedefType | file://:0:0:0:0 | int * |
|
||||
| using-alias.cpp:2:13:2:17 | type1 | CTypedefType | file://:0:0:0:0 | int |
|
||||
| using-alias.cpp:3:7:3:12 | using1 | UsingAliasTypedefType | file://:0:0:0:0 | float |
|
||||
| using-alias.cpp:5:16:5:20 | type2 | CTypedefType | file://:0:0:0:0 | float |
|
||||
| using-alias.cpp:6:7:6:12 | using2 | UsingAliasTypedefType | file://:0:0:0:0 | int |
|
||||
| using-alias.cpp:8:39:8:39 | X | NestedTypedefType | file://:0:0:0:0 | T * |
|
||||
| using-alias.cpp:8:39:8:39 | X | UsingAliasTypedefType | file://:0:0:0:0 | T * |
|
||||
| using-alias.cpp:10:7:10:7 | Y | UsingAliasTypedefType | file://:0:0:0:0 | int * |
|
||||
4
cpp/ql/test/library-tests/using-aliases/using-alias.ql
Normal file
4
cpp/ql/test/library-tests/using-aliases/using-alias.ql
Normal file
@@ -0,0 +1,4 @@
|
||||
import cpp
|
||||
|
||||
from TypedefType t
|
||||
select t, t.getCanonicalQLClass(), t.getUnderlyingType()
|
||||
Reference in New Issue
Block a user