forked from hsutter/cppfront
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cpp1): emit body of non local function expression (hsutter#601)
* test: add unit test for non local function expressions * fix(cpp1): emit body of non local function expression * test: add missing result
- Loading branch information
Showing
7 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
regression-tests/pure2-bugfix-for-non-local-function-expression.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,9 @@ | ||
v: <T> concept = :() -> bool = true;(); | ||
|
||
u: type == std::type_identity_t<decltype(:() = {})>; | ||
|
||
t: @struct type = { | ||
this: std::type_identity_t<decltype(:() = {})>; | ||
} | ||
|
||
main: () = { } |
Empty file.
Empty file.
33 changes: 33 additions & 0 deletions
33
regression-tests/test-results/pure2-bugfix-for-non-local-function-expression.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,33 @@ | ||
|
||
#define CPP2_USE_MODULES Yes | ||
|
||
//=== Cpp2 type declarations ==================================================== | ||
|
||
|
||
#include "cpp2util.h" | ||
|
||
|
||
#line 5 "pure2-bugfix-for-non-local-function-expression.cpp2" | ||
class t; | ||
|
||
|
||
//=== Cpp2 type definitions and function declarations =========================== | ||
|
||
#line 1 "pure2-bugfix-for-non-local-function-expression.cpp2" | ||
template<typename T> concept v = []() -> bool { return true; }(); | ||
|
||
using u = std::type_identity_t<decltype([]() -> void{})>; | ||
|
||
class t: public std::type_identity_t<decltype([]() -> void{})> { | ||
|
||
}; | ||
|
||
auto main() -> int; | ||
|
||
|
||
//=== Cpp2 function definitions ================================================= | ||
|
||
|
||
#line 9 "pure2-bugfix-for-non-local-function-expression.cpp2" | ||
auto main() -> int{} | ||
|
2 changes: 2 additions & 0 deletions
2
regression-tests/test-results/pure2-bugfix-for-non-local-function-expression.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-non-local-function-expression.cpp2... ok (all Cpp2, passes safety checks) | ||
|
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
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