We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Title: Function expression in alias has access specifier.
Minimal reproducer (https://cpp2.godbolt.org/z/d8jafjcrY):
v: @struct type = { f: std::type_identity_t<decltype(+ :(_: int) 0)> == :(_: int) 0; g: (i) i.f(); } main: () = { }
cppfront main.cpp2 clang++18 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -I . main.cpp
Expected result:
public: static const std::type_identity_t<decltype(+[]([[maybe_unused]] cpp2::in<int> unnamed_param_1) -> auto { return 0; })> f;
Actual result and error:
public: static const std::type_identity_t<decltype(+public: []([[maybe_unused]] cpp2::in<int> unnamed_param_1) -> auto { return 0; })> f;
//=== Cpp2 type declarations ==================================================== #include "cpp2util.h" class v; //=== Cpp2 type definitions and function declarations =========================== class v { public: static const std::type_identity_t<decltype(+public: []([[maybe_unused]] cpp2::in<int> unnamed_param_1) -> auto { return 0; })> f; public: [[nodiscard]] static auto g(auto const& i) -> auto; }; auto main() -> int; //=== Cpp2 function definitions ================================================= inline CPP2_CONSTEXPR std::type_identity_t<decltype(+[]([[maybe_unused]] cpp2::in<int> unnamed_param_1) -> auto { return 0; })> v::f = []([[maybe_unused]] cpp2::in<int> unnamed_param_1) -> auto { return 0; }; [[nodiscard]] auto v::g(auto const& i) -> auto { return CPP2_UFCS_0(f, i); } auto main() -> int{}
main.cpp2:2:55: error: expected expression 2 | public: static const std::type_identity_t<decltype(+public: []([[maybe_unused]] cpp2::in<int> unnamed_param_1) -> auto { return 0; })> f; | ^ 1 error generated.
See also:
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Title: Function expression in alias has access specifier.
Minimal reproducer (https://cpp2.godbolt.org/z/d8jafjcrY):
Commands:
cppfront main.cpp2 clang++18 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -I . main.cpp
Expected result:
Actual result and error:
Cpp2 lowered to Cpp1:
Output:
See also:
The text was updated successfully, but these errors were encountered: