-
Notifications
You must be signed in to change notification settings - Fork 260
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
[SUGGESTION] UFCS error message could be less misleading #439
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Actually, the best might be to call both forms, let the compiler spew errors, and the user choose what's wrong. Better implementation in the comment below. Old one here.See https://cpp2.godbolt.org/z/48bP4nj6c. Clang outputs
GCC outputs
|
It's possible to do better. A Combining with the solution of #439 (comment), it's possible to error with (https://cpp2.godbolt.org/z/z8ahaqzsP):
The above is good enough. Resolved stuff from here on.However, that prints Cpp1, and exposes implementation details (including lowering to Cpp1).
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Thanks for research, I don't expect those with macro is easy. |
Gives cpp1 diagnostic
error: use of undeclared identifier 'push_back'
CPP2_UFCS(push_back, std::move(vi), "oops");
vector.cpp2:6:2: note: in instantiation of function template specialization 'main()::(anonymous class)::operator()<std::vector, const char (&)[5]>' requested here
CPP2_UFCS(push_back, std::move(vi), "oops");
The text was updated successfully, but these errors were encountered: