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

Function pointer from generic lambda #50

Open
DanielBelow opened this issue Jan 10, 2020 · 1 comment
Open

Function pointer from generic lambda #50

DanielBelow opened this issue Jan 10, 2020 · 1 comment

Comments

@DanielBelow
Copy link

void test() {
  void (*func)(auto) = [](auto x) {};
}

crashes the compiler after triggering this assert:

clang-10: llvm-project/clang/lib/AST/Type.cpp:2056: bool clang::Type::isConstantSizeType() const: 
Assertion `!isDependentType() && "This doesn't make sense for dependent types"' failed.

Same code on https://godbolt.org/z/-f8YBy crashes a bit later.

@DanielBelow DanielBelow changed the title Function pointer with generic lambda Function pointer from generic lambda Jan 10, 2020
@marehr
Copy link

marehr commented Feb 7, 2020

This compiles now with:

<source>:2:16: error: 'auto' not allowed in function prototype that is not a function declaration
  void (*func)(auto) = [](auto x) {};
               ^~~~

1 error generated.
Compiler returned: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants