Skip to content
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

template lambda not compiling #176

Closed
kobi-ca opened this issue Apr 9, 2019 · 3 comments
Closed

template lambda not compiling #176

kobi-ca opened this issue Apr 9, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@kobi-ca
Copy link

kobi-ca commented Apr 9, 2019

Shouldn't this work with 17 or 2a?

#include <iostream>
 
int main()
{
	auto foo = []<typename T>(T i) { return 1; };
    foo(3);
    return 0;
}
@kobi-ca
Copy link
Author

kobi-ca commented Apr 9, 2019

getting

/home/insights/insights.cpp:7:15: error: expected body of lambda expression
        auto foo = []<typename T>(T i) { return 1; };
                     ^
/home/insights/insights.cpp:7:25: error: expected a qualified name after 'typename'
        auto foo = []<typename T>(T i) { return 1; };
                               ^
2 errors generated.

@andreasfertig
Copy link
Owner

Hello @kobi-ca,

you are trying to use P0428R2 which is a 2a feature. However, it is not implemented in Clang yet (see also cppreference.com).
I'm already watching the progress, but even if it gets implemented in Clang it will take to the next major release to be available in C++ Insights.
I leave that issue open until it is available.

Andreas

@kobi-ca
Copy link
Author

kobi-ca commented Apr 9, 2019

got it. thanks for the clarification.

@stale stale bot added the stale No activity label Jun 8, 2019
@andreasfertig andreasfertig added WIP Work in progress and removed stale No activity labels Jun 10, 2019
Repository owner deleted a comment from stale bot Jun 10, 2019
andreasfertig added a commit that referenced this issue Oct 18, 2019
Fixed #176: Switching to LLVM 9 gives us P0428.
@andreasfertig andreasfertig added enhancement New feature or request and removed WIP Work in progress labels Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants