-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
And do a round of output formatting cleanup (high diffs)
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,17 @@ | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp:16:36: error: expected ‘;’ at end of member declaration | ||
16 | public: explicit element(auto&& n) | ||
| ^ | ||
| ; | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:36: error: expected ‘;’ at end of member declaration | ||
In file included from pure2-bugfix-for-requires-clause-in-forward-declaration.cpp:7: | ||
../../../include/cpp2util.h:10005:47: error: static assertion failed: GCC 11 or higher is required to support variables and type-scope functions that have a 'requires' clause. This includes a type-scope 'forward' parameter of non-wildcard type, such as 'func: (this, forward s: std::string)', which relies on being able to add a 'requires' clause - in that case, use 'forward s: _' instead if you need the result to compile with GCC 10. | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp:17:1: note: in expansion of macro ‘CPP2_REQUIRES_’ | ||
17 | CPP2_REQUIRES_ (std::is_same_v<CPP2_TYPEOF(n), std::string>) | ||
| ^~~~~~~~~~~~~~ | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:4:1: note: in expansion of macro ‘CPP2_REQUIRES_’ | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:46: error: expected ‘;’ at end of member declaration | ||
In file included from pure2-bugfix-for-requires-clause-in-forward-declaration.cpp:7: | ||
../../../include/cpp2util.h:10005:47: error: static assertion failed: GCC 11 or higher is required to support variables and type-scope functions that have a 'requires' clause. This includes a type-scope 'forward' parameter of non-wildcard type, such as 'func: (this, forward s: std::string)', which relies on being able to add a 'requires' clause - in that case, use 'forward s: _' instead if you need the result to compile with GCC 10. | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:4:1: note: in expansion of macro ‘CPP2_REQUIRES_’ | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:3: error: no declaration matches ‘element::element(auto:90&&) requires is_same_v<typename std::remove_cv<typename std::remove_reference<decltype(element::__ct ::n)>::type>::type, std::__cxx11::string>’ | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:5:11: note: candidates are: ‘element::element(const element&)’ | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp:16:20: note: ‘template<class auto:88> element::element(auto:88&&)’ | ||
16 | public: explicit element(auto&& n) | ||
| ^~~~~~~ | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp:14:7: note: ‘class element’ defined here | ||
14 | class element { | ||
| ^~~~~~~ | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:3: error: expected unqualified-id before ‘{’ token | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:20: note: ‘template<class auto:88> element::element(auto:88&&)’ | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:1:7: note: ‘class element’ defined here | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:5:78: error: expected unqualified-id before ‘{’ token | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:8: error: no declaration matches ‘element& element::operator=(auto:91&&) requires is_same_v<typename std::remove_cv<typename std::remove_reference<decltype(element::operator=::n)>::type>::type, std::__cxx11::string>’ | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:6:16: note: candidates are: ‘void element::operator=(const element&)’ | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:3:16: note: ‘template<class auto:89> element& element::operator=(auto:89&&)’ | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp:14:7: note: ‘class element’ defined here | ||
14 | class element { | ||
| ^~~~~~~ | ||
pure2-bugfix-for-requires-clause-in-forward-declaration.cpp2:1:7: note: ‘class element’ defined here |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,21 @@ | |
|
||
#include "cpp2util.h" | ||
|
||
#line 1 "mixed-as-for-variant-20-types.cpp2" | ||
This comment has been minimized.
Sorry, something went wrong.
gregmarr
Contributor
|
||
|
||
|
||
//=== Cpp2 type definitions and function declarations =========================== | ||
|
||
#line 1 "mixed-as-for-variant-20-types.cpp2" | ||
template<int I> | ||
struct X { operator int() const { return I; } }; | ||
|
||
#line 4 "mixed-as-for-variant-20-types.cpp2" | ||
[[nodiscard]] auto main() -> int; | ||
|
||
|
||
//=== Cpp2 function definitions ================================================= | ||
|
||
#line 1 "mixed-as-for-variant-20-types.cpp2" | ||
|
||
#line 4 "mixed-as-for-variant-20-types.cpp2" | ||
[[nodiscard]] auto main() -> int{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,18 @@ | |
|
||
#include "cpp2util.h" | ||
|
||
#line 1 "mixed-bugfix-for-cpp2-comment-cpp1-sequence.cpp2" | ||
This comment has been minimized.
Sorry, something went wrong.
gregmarr
Contributor
|
||
|
||
|
||
//=== Cpp2 type definitions and function declarations =========================== | ||
|
||
#line 1 "mixed-bugfix-for-cpp2-comment-cpp1-sequence.cpp2" | ||
This comment has been minimized.
Sorry, something went wrong.
gregmarr
Contributor
|
||
extern cpp2::i32 x; | ||
int main() { } | ||
// ugh | ||
|
||
//=== Cpp2 function definitions ================================================= | ||
|
||
#line 1 "mixed-bugfix-for-cpp2-comment-cpp1-sequence.cpp2" | ||
cpp2::i32 x {0}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,12 @@ | |
|
||
#include "cpp2util.h" | ||
|
||
#line 1 "mixed-forwarding.cpp2" | ||
|
||
|
||
//=== Cpp2 type definitions and function declarations =========================== | ||
|
||
#line 1 "mixed-forwarding.cpp2" | ||
#include <iostream> | ||
#include <utility> | ||
|
||
|
@@ -26,24 +28,18 @@ auto use([[maybe_unused]] auto const& unnamed_param_1) -> void; | |
|
||
// invoking each of these with an rvalue std::pair argument ... | ||
auto apply_implicit_forward(auto&& t) -> void | ||
CPP2_REQUIRES (std::is_same_v<CPP2_TYPEOF(t), std::pair<X,X>>) | ||
#line 16 "mixed-forwarding.cpp2" | ||
; | ||
|
||
CPP2_REQUIRES (std::is_same_v<CPP2_TYPEOF(t), std::pair<X,X>>) ; | ||
|
||
#line 20 "mixed-forwarding.cpp2" | ||
auto apply_explicit_forward(auto&& t) -> void | ||
CPP2_REQUIRES (std::is_same_v<CPP2_TYPEOF(t), std::pair<X,X>>) | ||
#line 20 "mixed-forwarding.cpp2" | ||
; | ||
|
||
CPP2_REQUIRES (std::is_same_v<CPP2_TYPEOF(t), std::pair<X,X>>) ; | ||
This comment has been minimized.
Sorry, something went wrong.
gregmarr
Contributor
|
||
|
||
#line 25 "mixed-forwarding.cpp2" | ||
[[nodiscard]] auto main() -> int; | ||
|
||
|
||
//=== Cpp2 function definitions ================================================= | ||
|
||
#line 1 "mixed-forwarding.cpp2" | ||
|
||
#line 11 "mixed-forwarding.cpp2" | ||
auto copy_from([[maybe_unused]] auto unnamed_param_1) -> void{} | ||
|
@@ -52,16 +48,14 @@ auto use([[maybe_unused]] auto const& unnamed_param_1) -> void{} | |
|
||
#line 16 "mixed-forwarding.cpp2" | ||
auto apply_implicit_forward(auto&& t) -> void | ||
requires (std::is_same_v<CPP2_TYPEOF(t), std::pair<X,X>>) | ||
#line 16 "mixed-forwarding.cpp2" | ||
{ | ||
requires (std::is_same_v<CPP2_TYPEOF(t), std::pair<X,X>>) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
JohelEGP
Contributor
|
||
#line 17 "mixed-forwarding.cpp2" | ||
copy_from(t.first); // copies | ||
copy_from(CPP2_FORWARD(t).second);// moves | ||
} | ||
auto apply_explicit_forward(auto&& t) -> void | ||
requires (std::is_same_v<CPP2_TYPEOF(t), std::pair<X,X>>) | ||
#line 20 "mixed-forwarding.cpp2" | ||
{ | ||
requires (std::is_same_v<CPP2_TYPEOF(t), std::pair<X,X>>) { | ||
#line 21 "mixed-forwarding.cpp2" | ||
copy_from(CPP2_FORWARD(t).first);// moves | ||
copy_from(CPP2_FORWARD(t).second);// moves | ||
} | ||
|
The first one of these is good, the second is redundant.