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(to_cpp1): emit template template parameters
- Loading branch information
Showing
5 changed files
with
65 additions
and
10 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
regression-tests/pure2-bugfix-for-template-template-parameter.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,5 @@ | ||
t: @struct <T: <_, _: _>> type = { } | ||
|
||
u: @struct <T, V: _> type = { } | ||
|
||
main: () = { _ = :t<u> = (); } |
32 changes: 32 additions & 0 deletions
32
regression-tests/test-results/pure2-bugfix-for-template-template-parameter.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,32 @@ | ||
|
||
#define CPP2_IMPORT_STD Yes | ||
|
||
//=== Cpp2 type declarations ==================================================== | ||
|
||
|
||
#include "cpp2util.h" | ||
|
||
#line 1 "pure2-bugfix-for-template-template-parameter.cpp2" | ||
template<template <typename UnnamedTypeParam1_1, auto UnnamedTypeParam2_2> class T> class t; | ||
#line 2 "pure2-bugfix-for-template-template-parameter.cpp2" | ||
|
||
template<typename T, auto V> class u; | ||
|
||
|
||
//=== Cpp2 type definitions and function declarations =========================== | ||
|
||
#line 1 "pure2-bugfix-for-template-template-parameter.cpp2" | ||
template<template <typename UnnamedTypeParam1_1, auto UnnamedTypeParam2_2> class T> class t {}; | ||
#line 2 "pure2-bugfix-for-template-template-parameter.cpp2" | ||
|
||
template<typename T, auto V> class u {}; | ||
|
||
auto main() -> int; | ||
|
||
//=== Cpp2 function definitions ================================================= | ||
|
||
#line 1 "pure2-bugfix-for-template-template-parameter.cpp2" | ||
|
||
#line 5 "pure2-bugfix-for-template-template-parameter.cpp2" | ||
auto main() -> int{static_cast<void>(t<u>{}); } | ||
|
2 changes: 2 additions & 0 deletions
2
regression-tests/test-results/pure2-bugfix-for-template-template-parameter.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-template-template-parameter.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