C++: Add tests for using aliases

This commit is contained in:
Matthew Gretton-Dann
2019-08-22 12:42:45 +01:00
parent 9ff38ebeee
commit fc75a6af5a
3 changed files with 23 additions and 0 deletions

View 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;

View File

@@ -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 * |

View File

@@ -0,0 +1,4 @@
import cpp
from TypedefType t
select t, t.getCanonicalQLClass(), t.getUnderlyingType()