-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: avoid unnamed parameter in function type template argument #1291
Open
JohelEGP
wants to merge
2
commits into
hsutter:main
Choose a base branch
from
JohelEGP:last_use
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,12 +1,21 @@ | ||
pure2-last-use.cpp2:273:36: error: expected variable name or 'this' in lambda capture list | ||
public: std::add_pointer_t<int([[maybe_unused]] cpp2::impl::in<int> unnamed_param_1)> g; | ||
^ | ||
pure2-last-use.cpp2:329:2: error: expected '>' | ||
}; | ||
^ | ||
pure2-last-use.cpp2:273:30: note: to match this '<' | ||
public: std::add_pointer_t<int([[maybe_unused]] cpp2::impl::in<int> unnamed_param_1)> g; | ||
^ | ||
pure2-last-use.cpp2:274:16: error: no template named 'move_only_function' in namespace 'std' | ||
public: std::move_only_function<int()> mf; | ||
~~~~~^ | ||
pure2-last-use.cpp2:275:16: error: no template named 'move_only_function' in namespace 'std' | ||
public: std::move_only_function<int(cpp2::impl::in<int> x)> mg; | ||
~~~~~^ | ||
pure2-last-use.cpp2:277:278: error: no member named 'move_only_function' in namespace 'std' | ||
CPP2_REQUIRES_ (std::is_convertible_v<CPP2_TYPEOF(f_), std::add_const_t<std::add_pointer_t<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(g_), std::add_const_t<std::add_pointer_t<int(cpp2::impl::in<int> inx)>>&> && std::is_convertible_v<CPP2_TYPEOF(mf_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(mg_), std::add_const_t<std::move_only_function<int(cpp2::impl::in<int> inx)>>&>) ; | ||
~~~~~^ | ||
../../../include/cpp2util.h:10008:43: note: expanded from macro 'CPP2_REQUIRES_' | ||
#define CPP2_REQUIRES_(...) requires (__VA_ARGS__) | ||
^~~~~~~~~~~ | ||
pure2-last-use.cpp2:277:305: error: expected expression | ||
CPP2_REQUIRES_ (std::is_convertible_v<CPP2_TYPEOF(f_), std::add_const_t<std::add_pointer_t<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(g_), std::add_const_t<std::add_pointer_t<int(cpp2::impl::in<int> inx)>>&> && std::is_convertible_v<CPP2_TYPEOF(mf_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(mg_), std::add_const_t<std::move_only_function<int(cpp2::impl::in<int> inx)>>&>) ; | ||
^ | ||
pure2-last-use.cpp2:277:310: error: use of address-of-label extension outside of a function body | ||
CPP2_REQUIRES_ (std::is_convertible_v<CPP2_TYPEOF(f_), std::add_const_t<std::add_pointer_t<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(g_), std::add_const_t<std::add_pointer_t<int(cpp2::impl::in<int> inx)>>&> && std::is_convertible_v<CPP2_TYPEOF(mf_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(mg_), std::add_const_t<std::move_only_function<int(cpp2::impl::in<int> inx)>>&>) ; | ||
^ | ||
pure2-last-use.cpp2:344:16: error: no template named 'move_only_function' in namespace 'std' | ||
public: std::move_only_function<int()> b; | ||
~~~~~^ | ||
|
@@ -23,52 +32,33 @@ pure2-last-use.cpp2:348:193: error: use of address-of-label extension outside of | |
CPP2_REQUIRES_ (std::is_convertible_v<CPP2_TYPEOF(a_), std::add_const_t<std::unique_ptr<int>>&> && std::is_convertible_v<CPP2_TYPEOF(b_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(c_), std::add_const_t<std::add_lvalue_reference_t<int>>&>) ; | ||
^ | ||
pure2-last-use.cpp2:773:69: error: no template named 'move_only_function' in namespace 'std' | ||
auto issue_888_1([[maybe_unused]] std::string unnamed_param_1, std::move_only_function<int([[maybe_unused]] cpp2::impl::in<int> unnamed_param_1)> size) -> void; | ||
auto issue_888_1([[maybe_unused]] std::string unnamed_param_1, std::move_only_function<int(cpp2::impl::in<int> x)> size) -> void; | ||
~~~~~^ | ||
pure2-last-use.cpp2:773:93: error: expected variable name or 'this' in lambda capture list | ||
auto issue_888_1([[maybe_unused]] std::string unnamed_param_1, std::move_only_function<int([[maybe_unused]] cpp2::impl::in<int> unnamed_param_1)> size) -> void; | ||
^ | ||
pure2-last-use.cpp2:773:156: error: expected unqualified-id | ||
auto issue_888_1([[maybe_unused]] std::string unnamed_param_1, std::move_only_function<int([[maybe_unused]] cpp2::impl::in<int> unnamed_param_1)> size) -> void; | ||
^ | ||
pure2-last-use.cpp2:773:160: error: expected '>' | ||
auto issue_888_1([[maybe_unused]] std::string unnamed_param_1, std::move_only_function<int([[maybe_unused]] cpp2::impl::in<int> unnamed_param_1)> size) -> void; | ||
^ | ||
pure2-last-use.cpp2:773:87: note: to match this '<' | ||
auto issue_888_1([[maybe_unused]] std::string unnamed_param_1, std::move_only_function<int([[maybe_unused]] cpp2::impl::in<int> unnamed_param_1)> size) -> void; | ||
^ | ||
pure2-last-use.cpp2:773:160: error: expected ')' | ||
auto issue_888_1([[maybe_unused]] std::string unnamed_param_1, std::move_only_function<int([[maybe_unused]] cpp2::impl::in<int> unnamed_param_1)> size) -> void; | ||
^ | ||
pure2-last-use.cpp2:773:17: note: to match this '(' | ||
auto issue_888_1([[maybe_unused]] std::string unnamed_param_1, std::move_only_function<int([[maybe_unused]] cpp2::impl::in<int> unnamed_param_1)> size) -> void; | ||
^ | ||
pure2-last-use.cpp2:271:7: error: missing '}' at end of definition of 'issue_857_4' | ||
class issue_857_4 { | ||
^ | ||
pure2-last-use.cpp2:905:1: note: still within definition of 'issue_857_4' here | ||
namespace captures { | ||
^ | ||
pure2-last-use.cpp2:279:272: error: no member named 'move_only_function' in namespace 'std' | ||
requires (std::is_convertible_v<CPP2_TYPEOF(f_), std::add_const_t<std::add_pointer_t<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(g_), std::add_const_t<std::add_pointer_t<int(cpp2::impl::in<int> in_)>>&> && std::is_convertible_v<CPP2_TYPEOF(mf_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(mg_), std::add_const_t<std::move_only_function<int(cpp2::impl::in<int> in_)>>&>) | ||
requires (std::is_convertible_v<CPP2_TYPEOF(f_), std::add_const_t<std::add_pointer_t<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(g_), std::add_const_t<std::add_pointer_t<int(cpp2::impl::in<int> inx)>>&> && std::is_convertible_v<CPP2_TYPEOF(mf_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(mg_), std::add_const_t<std::move_only_function<int(cpp2::impl::in<int> inx)>>&>) | ||
~~~~~^ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be one of the lowering bugs mentioned at 212eb15#commitcomment-147040717. |
||
pure2-last-use.cpp2:279:299: error: expected expression | ||
requires (std::is_convertible_v<CPP2_TYPEOF(f_), std::add_const_t<std::add_pointer_t<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(g_), std::add_const_t<std::add_pointer_t<int(cpp2::impl::in<int> in_)>>&> && std::is_convertible_v<CPP2_TYPEOF(mf_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(mg_), std::add_const_t<std::move_only_function<int(cpp2::impl::in<int> in_)>>&>) | ||
requires (std::is_convertible_v<CPP2_TYPEOF(f_), std::add_const_t<std::add_pointer_t<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(g_), std::add_const_t<std::add_pointer_t<int(cpp2::impl::in<int> inx)>>&> && std::is_convertible_v<CPP2_TYPEOF(mf_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(mg_), std::add_const_t<std::move_only_function<int(cpp2::impl::in<int> inx)>>&>) | ||
^ | ||
pure2-last-use.cpp2:279:304: error: use of address-of-label extension outside of a function body | ||
requires (std::is_convertible_v<CPP2_TYPEOF(f_), std::add_const_t<std::add_pointer_t<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(g_), std::add_const_t<std::add_pointer_t<int(cpp2::impl::in<int> in_)>>&> && std::is_convertible_v<CPP2_TYPEOF(mf_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(mg_), std::add_const_t<std::move_only_function<int(cpp2::impl::in<int> in_)>>&>) | ||
requires (std::is_convertible_v<CPP2_TYPEOF(f_), std::add_const_t<std::add_pointer_t<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(g_), std::add_const_t<std::add_pointer_t<int(cpp2::impl::in<int> inx)>>&> && std::is_convertible_v<CPP2_TYPEOF(mf_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(mg_), std::add_const_t<std::move_only_function<int(cpp2::impl::in<int> inx)>>&>) | ||
^ | ||
pure2-last-use.cpp2:278:14: error: out-of-line definition of 'issue_857_4' does not match any declaration in 'issue_857_4' | ||
issue_857_4::issue_857_4(auto&& f_, auto&& g_, auto&& mf_, auto&& mg_) | ||
^~~~~~~~~~~ | ||
pure2-last-use.cpp2:281:272: error: member initializer 'g' does not name a non-static data member or base class | ||
, g{ CPP2_FORWARD(g_) } | ||
^~~~~~~~~~~~~~~~~~~~~ | ||
pure2-last-use.cpp2:282:272: error: member initializer 'mf' does not name a non-static data member or base class | ||
, mf{ CPP2_FORWARD(mf_) } | ||
^~~~~~~~~~~~~~~~~~~~~~~ | ||
pure2-last-use.cpp2:283:272: error: member initializer 'mg' does not name a non-static data member or base class | ||
, mg{ CPP2_FORWARD(mg_) }{} | ||
^~~~~~~~~~~~~~~~~~~~~~~ | ||
pure2-last-use.cpp2:349:155: error: no member named 'move_only_function' in namespace 'std' | ||
requires (std::is_convertible_v<CPP2_TYPEOF(a_), std::add_const_t<std::unique_ptr<int>>&> && std::is_convertible_v<CPP2_TYPEOF(b_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(c_), std::add_const_t<std::add_lvalue_reference_t<int>>&>) | ||
~~~~~^ | ||
pure2-last-use.cpp2:349:182: error: expected expression | ||
requires (std::is_convertible_v<CPP2_TYPEOF(a_), std::add_const_t<std::unique_ptr<int>>&> && std::is_convertible_v<CPP2_TYPEOF(b_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(c_), std::add_const_t<std::add_lvalue_reference_t<int>>&>) | ||
^ | ||
pure2-last-use.cpp2:349:187: error: use of address-of-label extension outside of a function body | ||
requires (std::is_convertible_v<CPP2_TYPEOF(a_), std::add_const_t<std::unique_ptr<int>>&> && std::is_convertible_v<CPP2_TYPEOF(b_), std::add_const_t<std::move_only_function<int()>>&> && std::is_convertible_v<CPP2_TYPEOF(c_), std::add_const_t<std::add_lvalue_reference_t<int>>&>) | ||
^ | ||
pure2-last-use.cpp2:773:69: error: no template named 'move_only_function' in namespace 'std' | ||
auto issue_888_1([[maybe_unused]] std::string unnamed_param_1, std::move_only_function<int(cpp2::impl::in<int> x)> size) -> void{ | ||
~~~~~^ | ||
error: constexpr if condition is not a constant expression | ||
pure2-last-use.cpp2:774:41: note: in instantiation of function template specialization 'issue_888_1(std::string, int)::(anonymous class)::operator()<int>' requested here | ||
static_cast<void>(CPP2_UFCS_MOVE(size)(0)); | ||
^ | ||
error: constexpr if condition is not a constant expression | ||
fatal error: too many errors emitted, stopping now [-ferror-limit=] | ||
20 errors generated. |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Regressions weren't re-run so I did that and committed the results.
Note these Clang-12 results in particular changed, can you check the diffs and see if they're benign?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the change looks right.