-
Notifications
You must be signed in to change notification settings - Fork 249
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
[BUG] in
parameter's type is non-deducible
#367
Comments
Minimal reproducer (https://godbolt.org/z/3v8b36s3q):
Commands: cppfront x.cpp2
clang++17 -std=c++2b -stdlib=libc++ -I $CPPFRONT_INCLUDE_DIR x.cpp Expected result: template<std::regular T> auto f(T _) -> void{} Actual result and error: template<std::regular T> auto f(cpp2::in<T> _) -> void{} Full generated Cpp1.//=== Cpp2 type declarations ====================================================
#include "cpp2util.h"
//=== Cpp2 type definitions and function declarations ===========================
#line 1 "/app/main.cpp2"
template<std::regular T> auto f(cpp2::in<T> _) -> void;
auto main() -> int;
//=== Cpp2 function definitions =================================================
#line 1 "/app/main.cpp2"
template<std::regular T> auto f(cpp2::in<T> _) -> void{}
auto main() -> int { f(0); }
|
Thanks! There are two examples here, taking them one by one...
|
The generated code looks good now.
Yes! I felt something was odd, but couldn't quite grasp it. |
….>`, not just `T`, closes hsutter#367
Discovered at #343 (comment).
A parameter type that uses a template parameter,
when lowered to C++1, is wrapped in
cpp2::in
,making it non-deducible.
Minimal reproducer (https://godbolt.org/z/GoMWoT3WM):
Commands:
cppfront x.cpp2 clang++17 -std=c++2b -stdlib=libc++ -I $CPPFRONT_INCLUDE_DIR x.cpp
Expected result:
template<typename T> auto f(std::vector<T> _) -> void{}
to be generated (no use of
cpp2::in
).Actual result and error:
Generated C++1.
The text was updated successfully, but these errors were encountered: