Skip to content

Commit fc75a6a

Browse files
author
Matthew Gretton-Dann
committed
C++: Add tests for using aliases
1 parent 9ff38eb commit fc75a6a

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
typedef int type1;
3+
using using1 = float;
4+
5+
typedef using1 type2;
6+
using using2 = type1;
7+
8+
template<typename T> struct S { using X = T*; };
9+
10+
using Y = S<int>::X;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
| file://:0:0:0:0 | X | NestedTypedefType | file://:0:0:0:0 | int * |
2+
| file://:0:0:0:0 | X | UsingAliasTypedefType | file://:0:0:0:0 | int * |
3+
| using-alias.cpp:2:13:2:17 | type1 | CTypedefType | file://:0:0:0:0 | int |
4+
| using-alias.cpp:3:7:3:12 | using1 | UsingAliasTypedefType | file://:0:0:0:0 | float |
5+
| using-alias.cpp:5:16:5:20 | type2 | CTypedefType | file://:0:0:0:0 | float |
6+
| using-alias.cpp:6:7:6:12 | using2 | UsingAliasTypedefType | file://:0:0:0:0 | int |
7+
| using-alias.cpp:8:39:8:39 | X | NestedTypedefType | file://:0:0:0:0 | T * |
8+
| using-alias.cpp:8:39:8:39 | X | UsingAliasTypedefType | file://:0:0:0:0 | T * |
9+
| using-alias.cpp:10:7:10:7 | Y | UsingAliasTypedefType | file://:0:0:0:0 | int * |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import cpp
2+
3+
from TypedefType t
4+
select t, t.getCanonicalQLClass(), t.getUnderlyingType()

0 commit comments

Comments
 (0)