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: fix(to_cpp1): type alias loses the pointer to function type.
Minimal reproducer (https://cpp2.godbolt.org/z/qK1PGfKqb):
main: () = { f_t: type == * () -> void; static_assert(std::is_pointer_v<f_t>); }
cppfront main.cpp2 clang++-18 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -Werror=unused-value -Werror=unused-parameter -Werror=unused-variable -I . main.cpp
Expected result:
using f_t = void(*)();
Actual result and error:
using f_t = void();
//=== Cpp2 type declarations ==================================================== #include "cpp2util.h" //=== Cpp2 type definitions and function declarations =========================== auto main() -> int; //=== Cpp2 function definitions ================================================= auto main() -> int{ using f_t = void(); static_assert(std::is_pointer_v<f_t>); }
main.cpp2:3:17: error: static assertion failed due to requirement 'std::is_pointer_v<void ()>' 3 | static_assert(std::is_pointer_v<f_t>); | ^~~~~~~~~~~~~~~~~~~~~~ 1 error generated.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Title: fix(to_cpp1): type alias loses the pointer to function type.
Minimal reproducer (https://cpp2.godbolt.org/z/qK1PGfKqb):
Commands:
cppfront main.cpp2 clang++-18 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -Werror=unused-value -Werror=unused-parameter -Werror=unused-variable -I . main.cpp
Expected result:
Actual result and error:
Cpp2 lowered to Cpp1:
Output:
The text was updated successfully, but these errors were encountered: