-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Default initialize function argument * Add output to test to show that defaults were applied --------- Co-authored-by: Herb Sutter <[email protected]>
- Loading branch information
Showing
29 changed files
with
90 additions
and
5 deletions.
There are no files selected for viewing
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,14 @@ | ||
auto cxx(int x, std::string y) -> void { | ||
std::cout << x << " \"" << y << "\"" << "\n"; | ||
} | ||
|
||
cxx2 : (x : int, y : std::string) = { | ||
std::cout << "(x)$ \"(y)$\"\n"; | ||
} | ||
|
||
main : () = { | ||
cxx(1, "test"); | ||
cxx((), ()); | ||
cxx2(1, "test"); | ||
cxx2((), ()); | ||
} |
Empty file.
Empty file.
Empty file.
Empty file.
4 changes: 4 additions & 0 deletions
4
regression-tests/test-results/clang-12-c++20/mixed-default-arguments.cpp.execution
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,4 @@ | ||
1 "test" | ||
0 "" | ||
1 "test" | ||
0 "" |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
4 changes: 4 additions & 0 deletions
4
regression-tests/test-results/gcc-10-c++20/mixed-default-arguments.cpp.execution
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,4 @@ | ||
1 "test" | ||
0 "" | ||
1 "test" | ||
0 "" |
Empty file.
Empty file.
Empty file.
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
g++-14 (Ubuntu 14-20240412-0ubuntu1) 14.0.1 20240412 (experimental) [master r14-9935-g67e1433a94f] | ||
g++ (GCC) 14.1.1 20240607 (Red Hat 14.1.1-5) | ||
Copyright (C) 2024 Free Software Foundation, Inc. | ||
This is free software; see the source for copying conditions. There is NO | ||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
|
4 changes: 4 additions & 0 deletions
4
regression-tests/test-results/gcc-14-c++2b/mixed-default-arguments.cpp.execution
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,4 @@ | ||
1 "test" | ||
0 "" | ||
1 "test" | ||
0 "" |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
|
||
//=== Cpp2 type declarations ==================================================== | ||
|
||
|
||
#include "cpp2util.h" | ||
|
||
#line 1 "mixed-default-arguments.cpp2" | ||
|
||
|
||
//=== Cpp2 type definitions and function declarations =========================== | ||
|
||
#line 1 "mixed-default-arguments.cpp2" | ||
auto cxx(int x, std::string y) -> void { | ||
std::cout << x << " \"" << y << "\"" << "\n"; | ||
} | ||
|
||
#line 5 "mixed-default-arguments.cpp2" | ||
auto cxx2(cpp2::impl::in<int> x, cpp2::impl::in<std::string> y) -> void; | ||
|
||
#line 9 "mixed-default-arguments.cpp2" | ||
auto main() -> int; | ||
|
||
//=== Cpp2 function definitions ================================================= | ||
|
||
#line 1 "mixed-default-arguments.cpp2" | ||
|
||
#line 5 "mixed-default-arguments.cpp2" | ||
auto cxx2(cpp2::impl::in<int> x, cpp2::impl::in<std::string> y) -> void{ | ||
std::cout << (cpp2::to_string(x) + " \"" + cpp2::to_string(y) + "\"\n"); | ||
} | ||
|
||
#line 9 "mixed-default-arguments.cpp2" | ||
auto main() -> int{ | ||
cxx(1, "test"); | ||
cxx({}, {}); | ||
cxx2(1, "test"); | ||
cxx2({}, {}); | ||
} | ||
|
Empty file.
2 changes: 2 additions & 0 deletions
2
regression-tests/test-results/mixed-default-arguments.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 @@ | ||
mixed-default-arguments.cpp2... ok (mixed Cpp1/Cpp2, Cpp2 code passes safety checks) | ||
|
Empty file.
4 changes: 4 additions & 0 deletions
4
regression-tests/test-results/msvc-2022-c++latest/mixed-default-arguments.cpp.execution
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,4 @@ | ||
1 "test" | ||
0 "" | ||
1 "test" | ||
0 "" |
1 change: 1 addition & 0 deletions
1
regression-tests/test-results/msvc-2022-c++latest/mixed-default-arguments.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 @@ | ||
mixed-default-arguments.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
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