-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add unit test for recursion during lookup
- Loading branch information
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
regression-tests/pure2-bugfix-for-dependent-types-recursion.cpp2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
main: () = { | ||
a: type == b; | ||
b: type == a; | ||
_ = a::t; | ||
_ = b::t; | ||
} |
13 changes: 13 additions & 0 deletions
13
regression-tests/test-results/gcc-13/pure2-bugfix-for-dependent-types-recursion.cpp.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/home/johel/tmp/cppfront/GCCDebug/regression-tests/pure2-bugfix-for-dependent-types-recursion/build/_cppfront/pure2-bugfix-for-dependent-types-recursion.cpp: In function ‘int main()’: | ||
/home/johel/tmp/cppfront/GCCDebug/regression-tests/pure2-bugfix-for-dependent-types-recursion/build/_cppfront/pure2-bugfix-for-dependent-types-recursion.cpp:19:13: error: ‘b’ does not name a type | ||
19 | using a = b; | ||
| ^ | ||
/home/johel/tmp/cppfront/GCCDebug/regression-tests/pure2-bugfix-for-dependent-types-recursion/build/_cppfront/pure2-bugfix-for-dependent-types-recursion.cpp:20:13: error: ‘a’ does not name a type | ||
20 | using b = a; | ||
| ^ | ||
/home/johel/tmp/cppfront/GCCDebug/regression-tests/pure2-bugfix-for-dependent-types-recursion/build/_cppfront/pure2-bugfix-for-dependent-types-recursion.cpp:21:21: error: ‘a’ has not been declared | ||
21 | static_cast<void>(a::t); | ||
| ^ | ||
/home/johel/tmp/cppfront/GCCDebug/regression-tests/pure2-bugfix-for-dependent-types-recursion/build/_cppfront/pure2-bugfix-for-dependent-types-recursion.cpp:22:21: error: ‘b’ has not been declared | ||
22 | static_cast<void>(b::t); | ||
| ^ |
24 changes: 24 additions & 0 deletions
24
regression-tests/test-results/pure2-bugfix-for-dependent-types-recursion.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
#define CPP2_IMPORT_STD Yes | ||
|
||
//=== Cpp2 type declarations ==================================================== | ||
|
||
|
||
#include "cpp2util.h" | ||
|
||
|
||
|
||
//=== Cpp2 type definitions and function declarations =========================== | ||
|
||
auto main() -> int; | ||
|
||
|
||
//=== Cpp2 function definitions ================================================= | ||
|
||
auto main() -> int{ | ||
using a = b; | ||
using b = a; | ||
static_cast<void>(a::t); | ||
static_cast<void>(b::t); | ||
} | ||
|
2 changes: 2 additions & 0 deletions
2
regression-tests/test-results/pure2-bugfix-for-dependent-types-recursion.cpp2.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pure2-bugfix-for-dependent-types-recursion.cpp2... ok (all Cpp2, passes safety checks) | ||
|