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

Odd output for decltype return values. Lambda hunt. #490

Closed
olafurw opened this issue Jul 25, 2022 · 1 comment
Closed

Odd output for decltype return values. Lambda hunt. #490

olafurw opened this issue Jul 25, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@olafurw
Copy link

olafurw commented Jul 25, 2022

Found two things that stood out as odd.

Case A

auto foo() -> decltype([](){ return 4; });

This defines a lambda class but then uses it like this

__lambda_5_24 foo();
() -> decltype([](){ return 4; });

Which does not seem like correct C++

image

Case B

using x = decltype([](){ return 4; });
auto foo() -> x;

Which should be the same as Case A but the output does seem more correct but it does not define a lambda class.

using x = decltype([](){ return 4; });
__lambda_19_20 foo();

image

Insights link.
https://cppinsights.io/s/51754024

@andreasfertig andreasfertig added the bug Something isn't working label Jul 26, 2022
@andreasfertig
Copy link
Owner

Hello @olafurw,

thanks for reporting this. A fix is on its way.

Andreas

andreasfertig added a commit that referenced this issue Jul 27, 2022
Fixed #490: `FunctionDecl` at TU scope with a trailing-return...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants